tabBar的隐藏

来源:互联网 发布:hive sql select into 编辑:程序博客网 时间:2024/06/06 17:44

tabBar的隐藏


在使用UITabBarController的时候,tab页内是一个UINavigationController,在导航控制器中push一个新窗口,新窗口会默认显示底部的tab栏,如何使这个tab栏隐藏呢?

可以使用UIViewControll类的hidesBottomBarWhenPushed 属性,当hidesBottomBarWhenPushed设为YES时,将不显示tab栏。

可在需隐藏tab的UIViewControll的init方法调用调用

self.hidesBottomBarWhenPushed=YES;

另外,UINavigationController导航栏的隐藏可使用属性navigationBarHidden,如果需要动画效果可使用方法setNavigationBarHidden:animated:。

可在需隐藏导航栏的UIViewController的viewWillAppear:animated中使用

self.navigationController.navigationBarHidden = YES;

或者

[self.navigationController setNavigationBarHidden:YES animated:YES];
原创粉丝点击