UITabbar 与 UINavigation Controller 视图重叠

Posted

技术标签:

【中文标题】UITabbar 与 UINavigation Controller 视图重叠【英文标题】:UITabbar overlaps UINavigation Controller view 【发布时间】:2016-03-29 14:39:13 【问题描述】:

我有一个带有 3 个 UINavigationControllers 的 UITabBarController。

uITabBarController.viewControllers = [uINavigationController_1, uINavigationController_2, uINavigationController_3]

在每个 UINavigationController 中:

self.setViewControllers([self.someTableViewController], animated: false)

在某些TableViewController 中: self.navigationController?.pushViewController(viewController, animated: true)

UITabbar 与 UINavigationController 中的 View 重叠?

我曾尝试在代码中使用约束,在navigationController中如下:

override func updateViewConstraints() 
    self.view.bottomAnchor.constraintEqualToAnchor(self.tabBarController?.view.topAnchor).active = true
    super.updateViewConstraints()

【问题讨论】:

我觉得你问的不是很清楚,你能详细说明一下吗? 谢谢,希望更新更清楚。 【参考方案1】:

在 Interface Builder 中,选择有问题的 UINavigationController,单击 Attribute Inspector,然后取消选择“Extend Edges: Under Bottom Bars”。

【讨论】:

以上是关于UITabbar 与 UINavigation Controller 视图重叠的主要内容,如果未能解决你的问题,请参考以下文章