当 NavigationController 推送到 TabBarController 时,为什么在第一个选项卡栏项目之后,TableViewController 的 contentInset 是错误的

When a NavigationController push to a TabBarController , Why after the first tab bar item , TableViewController's contentInset is wrong

我的 TabBarItems 是 UITableViewController

当我从 NavigationController 推入 TabBarController 时, 在第一项之后,tableView.contentInsetUIEdgeInsetsMake(0, 0, 0, 0)

但有时,当我设置 tableView.contentInset = UIEdgeInsetsMake(64, 0, 0, 0) 时。 tableView.contentInset变成了UIEdgeInsetsMake(128, 0, 0, 0)

取消选中视图控制器属性中的调整滚动视图插入,或者 self.automaticallyAdjustsScrollViewInsets = NO 如果不使用故事板。这是在 iOS 7 中引入的,因此您可以根据需要进行版本检查。