Apple requires, that no text scrolls through their transparent status bar.
I am using the inAppBrowser
Plugin in my Phonegap Build app, which runs into exactly this problem. For some reason, the inAppbrowser
ignores the background I set for my App, and just shows the website behind the status bar objects.
I am using the StatusBarPlugin
to control my Status Bar
Javascript:
document.addEventListener("deviceready", onDeviceReady, false);
// Global InAppBrowser reference
var iabRef = null;
function iabLoadStart(event) {
StatusBar.hide();
}
function iabLoadStop(event) {
}
function iabClose(event) {
StatusBar.show();
iabRef.removeEventListener('loadstart', iabLoadStart);
iabRef.removeEventListener('loadstop', iabLoadStop);
iabRef.removeEventListener('exit', iabClose);
}
function openPage(url) {
window.open(url, '_blank', 'location=yes,enableViewportScale=yes,');
}
// STATUS Bar
function setStatusBar() {
StatusBar.show();
StatusBar.overlaysWebView(false);
StatusBar.backgroundColorByHexString("#C8DB2F");
}
// Cordova is ready
//
function onDeviceReady() {
checkConnection();
setStatusBar();
iabRef.addEventListener('loadstart', iabLoadStart);
iabRef.addEventListener('loadstop', iabLoadStop);
iabRef.addEventListener('exit', iabClose);
}
I have seen similar questions coming up here, but the answers didn't solve my problem.