I had the same problem, with the exact same issue.
Here is how I went about solving it (and now it works):
I reverted back the viewWillAppear function/method as it was before:
- (void)viewWillAppear:(BOOL)animated
{
// View defaults to full size. If you want to customize the view's size, or its subviews (e.g. webView),
// you can do so here.
//Lower screen 20px on ios 7
/*
if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7) {
CGRect viewBounds = [self.webView bounds];
viewBounds.origin.y = 20;
viewBounds.size.height = viewBounds.size.height - 20;
self.webView.frame = viewBounds;
}
*/
[super viewWillAppear:animated];
}
and instead went on changing a different function, viewDidLoad, to the following:
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view from its nib.
if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7) {
CGRect viewBounds = [self.webView bounds];
viewBounds.origin.y = 20;
viewBounds.size.height = viewBounds.size.height - 20;
self.webView.frame = viewBounds;
}
self.view.backgroundColor = [UIColor blackColor];
}
The difference here is, that the viewDidLoad will be executed only once (what you actually want), while viewWillAppear is executed EVERY time this view is shown/presented to the user.
I hope this helps.