[iOS]用hidesBottomBarWhenPushed属性实现隐藏BottomBar时候的的几个坑!
来源:互联网 发布:期货对冲交易 知乎 编辑:程序博客网 时间:2024/06/13 12:48
正确做法:
1\最简单的是在storyboard的里面
hidesBottomBarWhenPushed设置为YES就可以了
2\如果是代码创建的则:
override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: NSBundle?) {
super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil)
initialize()
}
override init(style: UITableViewStyle) {
super.init(style: style)
initialize()
}
required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
initialize()
}
private func initialize() {
tableView.dataSource = self
tableView.delegate = self
hidesBottomBarWhenPushed = true
setInit()
}
或者在创建好后,马上调用 vc.hidesBottomBarWhenPushed = true
下面有几个新手常掉进去的坑:
1\不能够在viewDidLoad() 方法里调用, 一定要在viewDidLoad加载之前 也就是 push之前调用:
2\区分下面两个方法
hidesBottomBarWhenPushed = true
self.navigationController?.hidesBottomBarWhenPushed = true 这个方法会因为没有被push前,就没有navigationController, 所以设置无效
1 0
- [iOS]用hidesBottomBarWhenPushed属性实现隐藏BottomBar时候的的几个坑!
- IOS中hidesBottomBarWhenPushed显示隐藏的问题
- iOS:hidesBottomBarWhenPushed的正确用法
- iOS:hidesBottomBarWhenPushed的正确用法
- iOS:hidesBottomBarWhenPushed的正确用法
- IOS 中 hidesBottomBarWhenPushed的用法
- iOS:hidesBottomBarWhenPushed的正确用法
- iOS:hidesBottomBarWhenPushed的正确用法
- iOS:hidesBottomBarWhenPushed的正确用法
- iOS:hidesBottomBarWhenPushed的正确用法
- iOS:hidesBottomBarWhenPushed的正确用法
- iOS:hidesBottomBarWhenPushed的正确用法
- iOS:hidesBottomBarWhenPushed的正确用法
- iOS:hidesBottomBarWhenPushed的正确用法
- iOS:hidesBottomBarWhenPushed的正确用法
- iOS hidesBottomBarWhenPushed的正确用法
- 隐藏tabbar的方法,self.hidesBottomBarWhenPushed
- hidesBottombarWhenPushed的隐藏与显示问题
- 第九周项目3——稀疏矩阵的三元组表示的实现及应用(2)
- 对android&安卓下jni的单步调试
- AFNetworking中UIImageView+AFNetworking等清除缓存方法
- 在同一个jsp页面包括嵌套页面出现2个相同的id会怎么样
- 第十周--建立二叉树的算法库
- [iOS]用hidesBottomBarWhenPushed属性实现隐藏BottomBar时候的的几个坑!
- 修改配置文件改变eclipse字体等相关配置
- 第9周项目2-对称矩阵压缩存储的实现与应用(2)
- Android LayoutAnimation使用及扩展
- Oracle与DB2数据存储模式的区别详解
- 第9章项目2 对称矩阵压缩存储的实现与应用(1)
- 静态资源版本更新与缓存之文件名语义化
- CentOS更改yum源与更新系统
- 为mysql数据库建立索引