Reputation: 521
I am creating a cordova phonegap app using html (ofc.), in iOS 7 the back of the carrier, signal strength, battery and clock, is a part of the app itself. this means that if you have some content that is supposed to be at the top of the screen will be behind that topbar. i'm not a fan of moving everything down to fit, because in iOS6 and android (and properly everybody else), this top bar is not a part of the app. is there a way to make the app window a bit smaller on iOS7 only, preferable a setting somewhere, or should i do some javascript to edit the css if the device is iOS7. and in this case, how do i do that?
Upvotes: 0
Views: 74
Reputation: 16296
Your phonegap app is running on a UIWebView
, you can access its frame and resize it accordingly. If I understood you well, you can do that natively. Open up your phonegap project in Xcode, in MainViewController, in viewWillAppear:
// Apply this only for iOS7 running devices and later..
if ([[[UIDevice currentDevice]systemVersion]floatValue] >= 7) {
CGRect frame = self.webView.frame;
frame.origin.y = 20;// move the webview down to 20 px
frame.size.height = frame.size.height - 20;
self.webView.frame = frame;
}
There is a jQuery solution as well, but since this is only iOS7 related, the native way seems to be the most efficient.
Upvotes: 1