Prototype UITableViewCell is not at top of UITableView in Storyboard

倾然丶 夕夏残阳落幕 提交于 2019-12-07 06:43:17

问题


As the questions already says: When I add a prototype UITableViewCell to my TableView, the cell is not displayed at the top, here is a image:

How can I get the cell to the top of my TableView again?


回答1:


The problem is that your trackViewController.automaticallyAdjustsScrollViewInsets == YES, so additional topInset of 64px will be added to first UIScrollView in its view (this is UITableView in your case).

You can do the following:

Set table view origin y to 0

or

set automaticallyAdjustsScrollViewInsets to NO.




回答2:


In storyboard select viewcontroller (the yellow circle with a white square inside) then click on extend edges under bottom bars option.

Remember to select your view controller not your tableview or tableviewcell.



来源:https://stackoverflow.com/questions/22379567/prototype-uitableviewcell-is-not-at-top-of-uitableview-in-storyboard

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!