2011-12-02 76 views
0

我在一个视图基于应用程序在iPhone的工作,我想表明,当它被装载的导航栏,我在viewDidLoad中功能使用[self.navigationController setNavigationBarHidden:NO animated:YES];,但仍呈现不一样简单视图导航栏上方,有什么问题导航栏查看基于应用

+1

你在你的项目中的导航控制器? – Vin

+0

我使用视图基于应用程序,默认情况下,现在,我只加了上面的代码,现在基于 –

+0

web应用程序?你的意思是你的应用程序是由Safari浏览器访问,或你有你的观点一个一个UIWebView。无论如何,你需要有一个UINavigationController来显示导航栏。备用解决方案是在您的视图上放置来自IB的导航栏。 – Vin

回答

1

self.viewController = [[[ViewController alloc] initWithNibName:@"ViewController" bundle:nil] autorelease]; 

    UINavigationController *navcontrol = [[UINavigationController alloc] initWithRootViewController:self.viewController]; 

    self.window.rootViewController = navcontrol; 
0

您需要的NavigationBar添加到您的视图。 调用此,如果您使用Xcode4然后为此在应用程序委托应该整理出来

[self.view addSubview:navigationController.view];