Reputation: 1691
I am developing an iOS app and using web view to show some html data in it. i have added navigation bar in it. navigation bar used to show before. But when i added below code,it stopped showing it.
// 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];
any help will be appreciated....
Upvotes: 0
Views: 172
Reputation: 9471
write this code in viewDidLoad of controller.
[self.navigationController setNavigationBarHidden:NO];
Your code perfectly working on my project.
Upvotes: 4