IOS7 status bar and inappbrowser (Phonegap Build)

Apple requires that no text scroll through the transparent status bar.

I use the plugin inAppBrowserin my PhoneGap Build application , which runs exactly in this problem. For some reason, it inAppBrowserignores the background that I set for my application and just displays the website behind the status bar objects.

I use StatusBarPluginJavascript to control my Status Bar:

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 saw similar questions following here , but the answers did not help solve my problem.

+3
source share
6 answers

, . iPhone inAppbrowser , (Cordova 3.4/IOS 7).

, , ( , ).

+2

: CDVInAppBrowser.m :

if (self = [super init]) {
    // default values
    self.location = YES;
    self.toolbar = YES;
    self.closebuttoncaption = nil;
    self.toolbarposition = kInAppBrowserToolbarBarPositionBottom;

:-) , , .

+2

InAppBrowser, JS , , IAB, , .

, , . Chrome .

, .

:

config.xml , InAppBrowser:

<gap:plugin name="org.apache.cordova.core.inappbrowser" />

, :

window.open('YOUR-URL-HERE', '_blank', 'toolbarposition=top');

InAppBrowser GitHub readme.

+1

cordova-plugin-inappbrowser iOS. , CSS(), , . , org.apache.cordova.statusbar StatusBar.overlaysWebView(false); .

statusbar . neilsteventon.

0

@alexkb, InAppBrowser, , , statusBar .

myinapp = window.open('YOUR-URL-HERE', '_blank', 'toolbarposition=top');
myinapp.addEventListener('exit', function (event) {
    StatusBar.overlaysWebView(true);
    StatusBar.overlaysWebView(false);
});
0

This fixed the problem when I hide and show the status bar when closing the application browser

var ref = window.open('http://google.com', '_blank');
ref.addEventListener('exit', function(event) {
    StatusBar.hide();
    StatusBar.show();
});
0
source

All Articles