swift - 在 Swift 4 中,如何正确隐藏 tabBar?
问题描述
如何使用“hidesBottomBarWhenPushed”正确隐藏 UITabBarController 的 tabBar?
视图控制器A:
hidesBottomBarWhenPushed = true
这成功隐藏了 tabBar,但即使 viewControllerA 从 viewControllerB 弹出,它也会永久隐藏。
解决方案
You can simply use this in your ViewDidLoad()
method.
self.tabBarController?.tabBar.hidden = true
For swift 3.0:
self.tabBarController?.tabBar.isHidden = true
Or you can change z position of tab bar this way:
self.tabBarController?.tabBar.layer.zPosition = -1
and if you want to show it again then:
self.tabBarController?.tabBar.layer.zPosition = 0
推荐阅读
- java - 如何一次从 Recyclerview Android 检索所有视图数据
- github - 访问 GitHub 部署仪表板
- javascript - 异步迭代(for-await-of)的一些实际示例?
- python - 键盘模块中的所有键名是什么?
- c++ - 无法获取 WPF 的 TextBox 控件的背景颜色
- git - 在 gitahead 中创建带注释的标签
- javascript - 基于长度如何在 vuejs 中验证确认密码?
- r - 如何输出两个网格图(grid.draw)并在shinyapp中下载?
- postgresql - PL/pgSQL 函数以递归方式获取参数和搜索表
- python - 此代码给出索引错误。我的讲师的代码在 test_board 中传递了另一个字符串,该字符串也未显示在输出中