如何隐藏或删除顶部的导航栏?

时间:2013-07-17 17:22:50

标签: iphone ios storyboard

此代码成功执行,然后打开“条款和条件页面”。但是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];

}

2 个答案:

答案 0 :(得分:6)

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

[navigationController setNavigationBarHidden:YES];

答案 1 :(得分:4)

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