hidesBottombarWhenPushed的隐藏与显示问题
2013-09-29 10:35
543 查看
http://stackoverflow.com/questions/5272290/how-to-hide-uitabbarcontroller
在UITabbarController包含的UINavigationController应用中,如果UINavigationController某一页(某个level)需要隐藏Tabbar,之前的做法是在push那一页之前,将那一页的ViewController中的hidesBottombarWhenPushed参数设为YES,这样当那一页push进UINavigationController中时,底部的Tabbar就会隐藏掉。
但是这种方法有一个潜在的而又巨大的问题,假设现在我有3个ViewController A,B,C,其中为Navigation的RootViewController,A中push B,B中push C。这时,如果我想要在B中隐藏Tabbar,而在C中显示Tabbar,根据最朴素的想法就是:
?
然而很可惜,虽然A中push B能让Tabbar隐藏,但是B中push C,就没办法让Tabbar显示出来了。这是一个比较郁闷的问题,我只能猜想其中的原理是,当设置某一层hidesBottomBarWhenPushed = YES之后,UITabbarController就像不存在一样,就连调用self.tabbarController或者self.navigationController.tabbarController也应该是nil。
所以解决办法只能是手动隐藏Tabbar。
在B中,加入以下代码:
?
以上代码参考了 http://stackoverflow.com/questions/5272290/how-to-hide-uitabbarcontroller
在UITabbarController包含的UINavigationController应用中,如果UINavigationController某一页(某个level)需要隐藏Tabbar,之前的做法是在push那一页之前,将那一页的ViewController中的hidesBottombarWhenPushed参数设为YES,这样当那一页push进UINavigationController中时,底部的Tabbar就会隐藏掉。
但是这种方法有一个潜在的而又巨大的问题,假设现在我有3个ViewController A,B,C,其中为Navigation的RootViewController,A中push B,B中push C。这时,如果我想要在B中隐藏Tabbar,而在C中显示Tabbar,根据最朴素的想法就是:
?
所以解决办法只能是手动隐藏Tabbar。
在B中,加入以下代码:
?
相关文章推荐
- IOS中hidesBottomBarWhenPushed显示隐藏的问题
- hidesBottomBarWhenPushed隐藏底部TabBar时push的VC出现白色遮挡问题
- storyboard设置hidesBottomBarWhenPushed时 界面跳转时tabbar会延迟一下再消失问题解决 以及设置后跳转navBar显示问题
- 问题: hidesBottombarWhenPushed多级push不显示tabbar
- 解决使用hidesBottomBarWhenPushed隐藏tabbar造成的黑条问题
- tabBar隐藏与显现 hidesBottomBarWhenPushed
- iOS跳转界面时隐藏tabBar的方法:hidesBottomBarWhenPushed
- 隐藏tabbar的方法,self.hidesBottomBarWhenPushed
- 关于设置hidesBottomBarWhenPushed无效的问题
- 隐藏tabbar的方法,self.hidesBottomBarWhenPushed
- hidesBottomBarWhenPushed导航栏的隐藏
- hidesBottomBarWhenPushed 设置为NO的问题
- tabBar隐藏与显现 hidesBottomBarWhenPushed
- [iOS]用hidesBottomBarWhenPushed属性实现隐藏BottomBar时候的的几个坑!
- hidesBottombarWhenPushed的副作用
- 设置hidesBottomBarWhenPushed无效果
- hidesBottomBarWhenPushed的使用
- [ios]iOS:hidesBottomBarWhenPushed的正确用法
- iOS:hidesBottomBarWhenPushed的正确用法
- 关于setHidesBottomBarWhenPushed的时机