[英]How to hide NavigationController on TabBar based iPhone app?
I'm building a TabBar based iPhone app. 我正在构建一个基于TabBar的iPhone应用程序。 I'm using xcode 4 and I add Navigation Controller as one of the item. 我正在使用xcode 4,并将“导航控制器”添加为其中一项。 It allows me to disable the Navigation Bar on the startup. 它允许我在启动时禁用导航栏。 I basically uncheck the Shows Navigation Bar . 我基本上取消选中“ 显示导航栏” 。
Navigation Bar does not show on the start up. 导航栏在启动时不显示。 But once I navigate to the detail view and come back Navigation Bar is showing again. 但是,一旦我导航到详细信息视图并返回,导航栏就会再次显示。 Please help where can I disable the Navigation bar? 请帮助我在哪里可以禁用导航栏?
Update 更新
Guys I'm using tabBar based app and for some reason it never get into the ViewDidLoad or viewWillAppear. 伙计们,我正在使用基于tabBar的应用程序,由于某种原因,它永远不会进入ViewDidLoad或viewWillAppear。
In your viewWillAppear method of the view controller set [self.navigationController setNavigationBarHidden:YES];
在视图控制器的viewWillAppear方法中设置[self.navigationController setNavigationBarHidden:YES];
Everytime your viewController calls viewWillAppear it will setNavigationBar to hidden 每当您的viewController调用viewWillAppear时,它将把NavigationBar设置为隐藏
Try: 尝试:
- (void)viewDidLoad
{
[super viewDidLoad];
self.navigationController.navigationBarHidden = YES;
}
将以下代码放在didFinishLaunching方法中的应用程序委托类中:
self.navigationController.navigationBarHidden = YES;
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.