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

标签 ios objective-c swift uitabbarcontroller

我的 TabBarItems 是 UITableViewController

当我从 NavigationController 插入 TabBarController 时, 第一个项目之后,tableView.contentInsetUIEdgeInsetsMake(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/

相关文章:

ios - Firebase 崩溃符号文件 : Unable to upload symbol file (reason unknown)

ios - UICollectionView 显示两行,但我只想要一行

objective-c - Xcode 无法识别通过类别添加的方法

objective-c - 为什么静态函数会消除 Xcode 中的 undefined symbol ?

ios - 在 View Controller 之间传递数据

ios - 用于聊天的 APN 推送通知

ios - 使用乘数自动布局在 xcode 8 的界面生成器中为不同的屏幕尺寸创建自动调整大小的 View

objective-c - 并行reduce算法实现

swift - 扩展协议(protocol)以实现不同的行为

SwiftUI navigationView within Modal 'pushing' 查看向下