I thought I had this cleared up but apparently not. I am using the code below to set a webview to appear between the top nag bar and tab bar at the bottom. This happens in my viewDidLoad() method. It was working fine on all simulators I had tested it on, however when I tested a friend's iPhone 4s running 7.1.1 the webview rendered spanning the entire height of the screen, covered by both the top nag bar and bottom tab bar.
How to I get the desired behavior across all devices and OS above 7?
self.webView = [[UIWebView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height)];
[self.view addSubview:self.webView];
self.webView.scalesPageToFit = true;
NSURL *url = [NSURL URLWithString:@"http://example.com/notifications.php"];
NSURLRequest *requestURL = [NSURLRequest requestWithURL:url];
[self.webView loadRequest:requestURL];
self.webView.scrollView.showsVerticalScrollIndicator = false;
self.navigationController.navigationBar.titleTextAttributes = @{UITextAttributeTextColor : [UIColor whiteColor]};
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
self.webView.delegate = self;
self.webView.scrollView.delegate = self;
It's because you are spanning the entire view in your rect make you need to subtract the height and width of the tab and nav bar
take a look at this example