Is it possible to disable floating headers in UITableView with UITableViewStylePlain?

前端 未结 29 1092
走了就别回头了
走了就别回头了 2020-11-29 15:02

I\'m using a UITableView to layout content \'pages\'. I\'m using the headers of the table view to layout certain images etc. and I\'d prefer it if they didn\'t

29条回答
  •  长情又很酷
    2020-11-29 15:37

    You should be able to fake this by using a custom cell to do your header rows. These will then scroll like any other cell in the table view.

    You just need to add some logic in your cellForRowAtIndexPath to return the right cell type when it is a header row.

    You'll probably have to manage your sections yourself though, i.e. have everything in one section and fake the headers. (You could also try returning a hidden view for the header view, but I don't know if that will work)

提交回复
热议问题