I am building a Cordova app, and I'm testing it on my iOS 6 device (iPod Touch w/ iOS 6.1.6). For some reason, the WebView is scrollable with an extra 20px, seemingly making up for the 20px status bar at the top of the screen. This sometimes causes the scrollable WebView to take focus, essentially causing "nothing" to scroll in the eyes of the user, rather than allowing scrollable div
s in my app to scroll. I have tried numerous fixes pertaining to config.xml changes, plugins, etc, but nothing makes a difference, which I've outlined below.
Tried manually hiding the status bar, with no effect.
// config.xml: <plugin name="org.apache.cordova.statusbar" version="0.1.7" /> <feature name="StatusBar"> <param name="ios-package" value="CDVStatusBar" /> </feature> // index.js (ondeviceready): window.StatusBar && window.StatusBar.hide();
Tried forcing the status bar to overlay the webview, essentially making the app a full 480px tall (instead of 460px):
// config.xml: <plugin name="org.apache.cordova.statusbar" version="0.1.7" /> <preference name="StatusBarOverlaysWebView" value="true" />
Tried forcing the status bar to not overlay the webview:
// config.xml: <plugin name="org.apache.cordova.statusbar" version="0.1.7" /> <preference name="StatusBarOverlaysWebView" value="false" /> <preference name="StatusBarBackgroundColor" value="#000000" /> <preference name="StatusBarStyle" value="lightcontent" />
Tried offsetting the body's margin-top by 20px, which just adds an extra 20px of dead whitespace:
// index.css: body { margin-top: 20px; }
Tried setting the app to fullscreen, which literally has no effect on the app whatsoever:
// config.xml: <preference name="Fullscreen" value="true" />
I even used Safari inspector to delete the
body
DOM node altogether, and it still scrolls 20px, telling me that it has nothing to do with the HTML so much as Cordova's implementation of the WebView.
Does anyone have a solution for this? I can't be the only one out there encountering this.