简体   繁体   English

如何在基于TabBar的iPhone应用程序上隐藏NavigationController?

[英]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.

相关问题 如何将TabBar添加到基于NavigationController的iPhone应用程序 - How to add a TabBar to NavigationController based iPhone app 在基于Tab的iPhone应用程序中,如何隐藏某些ViewControllers中的tabbar? - In Tab-based iPhone app, how to hide the tabbar in some ViewControllers? 在导航控制器中推送控制器时如何隐藏父标签栏 - How to hide parent tabbar when pushing controller in navigationController 如何在基于选项卡/导航控制器的模型中获取正确的ViewController - how to get the right viewcontroller in tabbar/navigationcontroller based model 如何在应用启动时隐藏标签栏? - How to hide a tabbar at the app startup? 隐藏横向中的Tabbar而不推送到NavigationController - Hide Tabbar in Landscape without pushing to NavigationController 导航控制器问题iphone下的自定义标签栏 - Custom tabbar below navigationcontroller issue iphone 如何将基于导航的iPhone应用程序转换为基于TabBar的应用程序 - How to convert Navigation-based iPhone app to TabBar-based app iPhone应用程序,navigationcontroller无法正常运行? - iPhone app, navigationcontroller not functioning? 基于标签栏的应用程序非常奇怪的iPhone应用程序崩溃问题 - Very strange iPhone app crash problem with tabbar based app
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM