TabBar隐藏了导航堆栈中的视图控制器内容

时间:2016-10-27 12:33:32

标签: ios swift uinavigationcontroller uitabbarcontroller

我从[{1}}扩展了自定义 let lineWeight = SKEase.createFloatTween(<start: CGFloat, end: CGFloat, time: TimeInterval, easingFunction: AHEasingFunction, setterBlock: ((SKNode, CGFloat) -> Void)) 类 有三个标签,每个标签都有不同的TabBarController UITabBarController。问题是,当我按下UINavigationController并且视图控制器成功加载但TabBar从底部隐藏当前推送的视图控制器的内容。可能是TabBar不会自动自动调整此视图控制器的父视图,或者可能存在任何其他问题。 这是视图的屏幕截图。 我在另一个有四个单元格的视图中有一个tableview。 tableView的父视图的约束top,leading,trailing和bottom等于零。 但主视图的底部布局位于tabBar下方。我猜这就是为什么它隐藏了我的内容。 我正在使用swift 2.2

Screenshot[1]

1 个答案:

答案 0 :(得分:0)

如果启用此检查,则

UINavigationControllerUITabBarController都具有isTranslucent的公共属性,然后当前视图控制器的父视图向上(导航栏下方)或向下(在标签栏下方) )所以为了避免视图对齐或高度的扩展,只需将半透明属性禁用为false。

目标C

self.navigationController.isTranslucent = NO
self.tabbarController.isTranslucent = NO

在Swift中

self.navigationController.isTranslucent = false
self.tabbarController.isTranslucent = false