iOS::导航栏不显示

iOS::导航栏不显示,ios,uinavigationbar,Ios,Uinavigationbar,我正在开发一个iOS应用程序,并使用web视图显示其中的一些html数据。 我在其中添加了导航栏。以前用于显示的导航栏。 但当我添加下面的代码时,它就停止显示了 // the base view for this view controller UIView *contentView = [[UIView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]]; contentView.backgroundColor = [U

我正在开发一个iOS应用程序,并使用web视图显示其中的一些html数据。 我在其中添加了导航栏。以前用于显示的导航栏。 但当我添加下面的代码时,它就停止显示了

// the base view for this view controller
UIView *contentView = [[UIView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]];
contentView.backgroundColor = [UIColor whiteColor];

// important for view orientation rotation
contentView.autoresizesSubviews = YES;
contentView.autoresizingMask = (UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight);
self.view = contentView;
[contentView release];

//Initialize the WebView -----------------------------------------------------------
CGRect webFrame = [[UIScreen mainScreen] applicationFrame];
   // webFrame.origin.y += kTopMargin + 5.0;    // leave from the URL input field and its label
//webFrame.origin.y -= 20.0;
myWebView = [[UIWebView alloc] initWithFrame:webFrame];
//myWebView.backgroundColor = [UIColor blackColor];
myWebView.backgroundColor = [UIColor whiteColor];
myWebView.scalesPageToFit = YES;
myWebView.detectsPhoneNumbers = NO;
//myWebView.dataDetectorTypes = UIDataDetectorTypeLink;
myWebView.autoresizingMask = (UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight);
myWebView.delegate = self;
[self.view addSubview: myWebView]; 

如有任何帮助,将不胜感激。…

在控制器的viewDidLoad中编写此代码

[self.navigationController setNavigationBarHidden:NO];

您的代码在我的项目中运行得非常好。

在控制器的viewDidLoad中编写此代码

[self.navigationController setNavigationBarHidden:NO];

您的代码在我的项目上运行得非常好。

appDelegate类中的窗口的RootViewController是什么?UINavigationController或ViewController。能否在此显示您的didFinishLaunchingWithOptions代码。是否可能与xib有一些问题?appDelegate类中窗口的RootViewController是什么?UINavigationController或ViewController。您能否在此显示您的didFinishLaunchingWithOptions代码。xib是否可能有问题?