ios - 删除导航 Controller 创建的标签栏占位符?

标签 ios swift uinavigationcontroller uitabbar

我在导航 Controller 中显示了一个 VC,由于某种原因,在推送它时,它创建了一个标签栏样式的占位符。

据我所知,该 View 不在 tabbarcontroller 中,因此我不确定为什么要创建它。所有 View 都是程序化的,没有 Storyboard。

这是问题的图片,有解决办法吗?我尝试在推送时隐藏标签栏,但没有效果

enter image description here

最佳答案

您的navigationcontoller 工具栏未隐藏。

隐藏 NavigationController 的工具栏。

编辑: 尝试这个- swift :

self.navigationController?.toolbar.isHidden = true

由于您已经通过代码创建了 Navigation Controller,因此您也可以在创建时执行此操作:

let navController = UINavigationController(rootViewController: myVC)
navController.toolbar.isHidden = true

关于ios - 删除导航 Controller 创建的标签栏占位符?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46607629/

相关文章:

ios - iOS 企业应用程序中的动态库注入(inject)失败

ios - UIImage 显示蓝色矩形而不是 JPEG 图像

swift - 我可以在 Swift 中创建仅限于某些值的数字类型吗?

ios - 如何在 Ios 中推送 rootviewcontroller

iphone - 使用不同 View 中 UICell 的内容更新 UILabel

iphone - 如何在 iPhone 应用程序中获取文件路径

swift - 为 imageview 创建通用变量以添加 uipangesture

ios - 当应用程序在后台时从信标接收信号

ios - 无法将值传递回 parentViewController

iphone - UINavigationController popToRootViewController,然后立即推送一个新 View