Created
March 21, 2014 09:43
-
-
Save saumya/9682820 to your computer and use it in GitHub Desktop.
Cordova(Phonegap) application, fixing the iOS 7 status bar
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (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. | |
//Original | |
//[super viewWillAppear:animated]; | |
//Fix for Cordova on iOS 7 | |
//Lower screen 20px on ios 7 | |
if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7) { | |
CGRect viewBounds = [self.webView bounds]; | |
viewBounds.origin.y = 18; | |
viewBounds.size.height = viewBounds.size.height - 18; | |
self.webView.frame = viewBounds; | |
} | |
[super viewWillAppear:animated]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment