[英]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. 我有一个UITableViewController,它嵌入在TabbarController中,而TabbarController又嵌入在UINavigationController中。 Now, the scrollview of the tableview scrolls the first 2 rows under the navigation bar on the top.
现在,tableview的scrollview滚动顶部导航栏中的前两行。 See screenshot:
看截图:
How can I adjust that? 我该如何调整?
self.tableView.contentInset = UIEdgeInsetsMake(64.0,0.0,44.0,0.0);
这对我有用(在viewDidLoad中)
Try navigationBar.translucent = NO;
尝试
navigationBar.translucent = NO;
in your viewDidLoad
. 在您的
viewDidLoad
。
This happens due to the transparency feature that they introduced on iOS 7. 发生这种情况是由于他们在iOS 7上引入了透明功能。
There's also another way: Unchecking the "Under Top Bars" in the storyboard will also fix the issue (select the view controller) 还有另一种方法:取消选中情节提要中的“顶部栏”也可以解决问题(选择视图控制器)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.