简体   繁体   中英

AutoLayout and UITableView: how to adjust for Tabbar?

I have an UITableViewController which is embedded in a TabbarController which in turn is embedded in a UINavigationController. Now, the scrollview of the tableview scrolls the first 2 rows under the navigation bar on the top. See screenshot: 在此处输入图片说明

How can I adjust that?

self.tableView.contentInset = UIEdgeInsetsMake(64.0,0.0,44.0,0.0);

这对我有用(在viewDidLoad中)

Try navigationBar.translucent = NO; in your viewDidLoad .

This happens due to the transparency feature that they introduced on iOS 7.

There's also another way: Unchecking the "Under Top Bars" in the storyboard will also fix the issue (select the view controller)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM