0

I'm at my wits end at this point, trying to get past the IOS7 issue whereby the statusbar overlaps the top of my app. The steps I've taken are:

  • phonegap plugins add org.apache.cordova.statusbar
  • Adding the following to my main config.xml: <gap:plugin name="org.apache.cordova.statusbar"/> <preference name="fullscreen" value="true" /> <preference name="StatusBarOverlaysWebView" value="false" /> <preference name="StatusBarStyle" value="default" /> <feature name="StatusBar"> <param name="ios-package" value="CDVStatusBar" onload="true" /> </feature>
  • From reading various SO posts, I've tried several times adding/removing both the plugin and the ios platform.

The plugin now successfully adjusts the status bar behavior on the simulator (running cordova run ios) but when I use Phonegap Build to actually run it on the device, alas the status bar still overlays my app webview.

Thanks in advance for the help.

Scott
  • 439
  • 3
  • 9
  • as you only have the problem when you use phonegap build, the problem should be on the config.xml. Anyway, try running locally on the device with cordova run ios --device – jcesarmobile Jul 07 '15 at 06:21
  • Yeah, on the simulator it works as expected (as I mentioned). It's only on the device that I'm continuing to have problems. Which is, needless to say, frustrating. – Scott Jul 07 '15 at 16:03
  • If you use cordova run ios --device it should install and run on the device – jcesarmobile Jul 07 '15 at 16:35

1 Answers1

0

You can open up MainViewController.c (I think that's what it's called in Cordova), find the viewDidLoad: method and insert code like this:

if (IS_IOS7_OR_LATER) {
    CGRect *frame = self.webview.frame;
    frame = CGRectMake(0, 20, frame.size.width, frame.size.height);
    self.webview.frame = frame;
}

where IS_IOS7_OR_LATER is a macro or some other code to check if we're running on iOS 7 or later.

paulvs
  • 11,963
  • 3
  • 41
  • 66