【问题标题】:How to hide Navigation Bar? [closed]如何隐藏导航栏? [关闭]
【发布时间】:2012-07-05 03:24:52
【问题描述】:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];
    // Override point for customization after application launch.
    MasterViewController *masterViewController = [[[MasterViewController alloc] initWithNibName:@"MasterViewController" bundle:nil] autorelease];
    self.navigationController = [[[UINavigationController alloc] initWithRootViewController:masterViewController] autorelease];
    self.window.rootViewController = self.navigationController;
    [self.window makeKeyAndVisible];
    return YES;

【问题讨论】:

  • 为什么要隐藏导航栏?
  • 也请用标准格式写出问题,以便阅读

标签: iphone objective-c navigationbar


【解决方案1】:

试试这个删除导航栏。

(BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 
{ 
    self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease]; 
   // Override point for customization after application launch. 
   MasterViewController *masterViewController = [[[MasterViewController alloc] initWithNibName:@"MasterViewController" bundle:nil] autorelease]; 
   self.window.rootViewController = masterViewController; 
   [self.window makeKeyAndVisible]; return YES;
}

【讨论】:

  • 问题已解决,谢谢
【解决方案2】:

设置navigationBarHidden 属性以隐藏导航栏。如需参考,请参阅UINavigationController 文档。

将以下语句添加到您的 didFinishLaunchingWithOptions 方法中。

[self.navigationController setNavigationBarHidden:YES animated:YES];

【讨论】:

  • 你的回答没有解决问题,但是回答感谢
猜你喜欢
  • 1970-01-01
  • 2016-06-16
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多