Remove empty space before cells in UITableView

后端 未结 30 1747
生来不讨喜
生来不讨喜 2020-11-30 16:39

I am currently trying to put a UITableView in a different location rather than at the top of my view controller. With this said, it is trying to add the header

相关标签:
30条回答
  • 2020-11-30 17:21

    Select the tableview in your storyboard and ensure that the style is set to "Plain", instead of "Grouped". You can find this setting in the attributes Inspector tab.

    0 讨论(0)
  • 2020-11-30 17:21

    I just found a solution for this.

    Just select tableview and clic Editor -> Arrange -> Send to Front

    It worked for me and hope it helps you all.

    0 讨论(0)
  • 2020-11-30 17:21

    Set the content insets to zero:

    0 讨论(0)
  • 2020-11-30 17:22

    I had this same problem and I'm pretty sure I had a UIView in there at one point. Simply copying the entire table view, deleting it, and pasting it again fixed it for me.

    0 讨论(0)
  • 2020-11-30 17:24

    In the Storyboard , set the contentInsets of your tableview to Never

    0 讨论(0)
  • 2020-11-30 17:25

    I'm still not sure what caused that extra space at the top, but I found that deleting the UITableView with the space and replacing it with a new one took the space away.

    I must have dragged a UIView in there accidentally, but I couldn't select it so I couldn't delete.

    0 讨论(0)
提交回复
热议问题