I just finished upgrading an iOS PhoneGap app to Cordova 2.1. The app builds fine, but when running it on the simulator, the content of the app seems to completely ignore the fact that the status bar is there. 20px of content is hidden underneath the status bar now and I cannot seem to add padding to shift it down even.
How do I fix this?
If you upgraded your application to use PhoneGap 2.1 from another version, your MainViewController.m file may not be up to date.
You need to have the following code in it:
#pragma mark - View lifecycle
- (void)viewWillAppear:(BOOL)animated
{
// Set the main view to utilize the entire application frame space of the device.
// Change this to suit your view's UI footprint needs in your application.
self.view.frame = [[UIScreen mainScreen] applicationFrame];
[super viewWillAppear:animated];
}
Once you have this function, your App will be back to normal!
(Solution found here)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With