2013-07-17 59 views
2

此代码成功执行,然后打开“条款和条件页面”。但1个问题,我面临页面顶部额外的一个导航栏显示。如何隐藏或删除页面顶部的导航栏?如何隐藏或删除顶部的导航栏?

ClsMainPageAppDelegate.m

#import "ClsMainPageAppDelegate.h" 
#import "ClsTermsandConditionViewController.h" 

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 
{ 

    UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil]; 
    ClsTermsandConditionViewController *ivc = [storyboard instantiateViewControllerWithIdentifier:@"termsandConditionControl"]; 
    UINavigationController *navigationController=[[UINavigationController alloc] initWithRootViewController:ivc]; 
    self.window.rootViewController=nil; 
    self.window.rootViewController = navigationController; 
    [self.window makeKeyAndVisible]; 

} 
+0

您在导航控制器中显示“条款和条件”视图控制器。你还在故事板中添加了导航栏吗? – rmaddy

回答

6

您是否阅读过文档? UINavigationController Class Reference

[navigationController setNavigationBarHidden:YES]; 
+0

这难道不是一个更大的问题吗?解决方案不应该找出为什么有两个导航栏? – rmaddy

+0

啊,这个问题起初并没有什么意义,谢谢。 – WrightsCS

4

在你的故事板选择您的导航控制器。在第4个标签的右侧取消选中显示导航栏。