我的 TabBarItems 是 UITableViewController
。
当我从 NavigationController 插入 TabBarController
时,
第一个项目之后,tableView.contentInset
为 UIEdgeInsetsMake(0, 0, 0, 0)
但有时,当我设置 tableView.contentInset = UIEdgeInsetsMake(64, 0, 0, 0)
时。 tableView.contentInset
变成了 UIEdgeInsetsMake(128, 0, 0, 0)
。
最佳答案
取消选中 View Controller 属性中的调整 ScrollView 插入,或者如果不使用 Storyboard ,则self.automaticallyAdjustsScrollViewInsets = NO
。这是在 iOS 7 中引入的,因此您可以根据需要进行版本检查。
关于ios - 当NavigationController推送到TabBarController时,为什么在第一个选项卡栏项目之后,TableViewController的contentInset是错误的,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32195155/