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

前端 未结 29 1054
走了就别回头了
走了就别回头了 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:27

    I have another even simpler solution, to be used without autolayout and with everything done through the XIB :

    1/ Put your header in the tableview by drag and dropping it directly on the tableview.

    2/ In the Size Inspector of the newly made header, just change its autosizing : you should only leave the top, left and right anchors, plus the fill horizontally.

    That's how it should be set for the header

    That should do the trick !

提交回复
热议问题