ios - 无法在 subview Controller 中隐藏选项卡栏

标签 ios swift storyboard

在嵌入 UINavigationController 的 containerView 中。该 navController 2 viewControllers 已连接。请参见下图。 enter image description here

一切正常,除了两个 childViewControllers 都有一个无论我尝试什么都无法隐藏的 TabBar。这是它在设备上的样子。 enter image description here 蓝色是containerView的背景色 这就是我试图对 childViewControllers 隐藏的方式

    self.tabBarController!.tabBar.hidden = true
    self.navigationController!.toolbarHidden = true
    self.navigationController!.tabBarController!.tabBar.hidden = true
    self.navigationController?.setNavigationBarHidden(true, animated: false)

从包含的 View Controller :

    self.childViewNavigationController.toolbarHidden = true
    self.childViewNavigationController.setToolbarHidden(true, animated: false)
    self.childViewNavigationController.tabBarController!.tabBar.hidden = true
    self.childViewNavigationController.setNavigationBarHidden(true, animated: false)

蓝色区域有 49 点高,这就是为什么我认为它是为标签栏保留的。

最佳答案

问题没有解决。幸运的是,主视图 Controller 需要呈现,而不是推送,所以 subview 的导航 Controller 没有从主视图 Controller 的导航 Controller 继承任何东西,标签栏区域消失了。

关于ios - 无法在 subview Controller 中隐藏选项卡栏,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34290344/

相关文章:

swift - Collection View 单元格 subview 框架在重复使用单元格之前不可用

ios - Swift firebase .observe 或 .observeSingleEvent 不起作用

c# - 使用 MediaElement + Storyboard 连续播放视频

ios - Storyboard - UILabel 自动收缩不起作用

ios - 更改传入推送通知的内容

iphone - ScrollView 在 Xcode 5 中不工作 - 没有效果, View 中不存在滚动

ios - 如何使用 OpenSSL 在 Swift 中防止错误输入 d2i_X509_REQ_bio 导致的 fatal error

ios - 奇怪的错误,当尝试滚动到底部时,collectionView View 滚动到倒数第二条消息

ios - 具有多个类的 Storyboard UIViewController

ios - 什么时候使用 NSString stringWithFormat;