Skip to content Skip to sidebar Skip to footer

How Can I Get The IOS Status Bar To *overlay* The App Surface Rather Than Pushing It Down?

I am developing a Phonegap app for iOS (and others). The view is landscape only. I am using Phonegap Build with PG 3.1. I am testing on an iPad3 with iOS7. I need a solution that w

Solution 1:

I got this to work beautifully in Cordova 3.6 + iOS 7.1. And considering that iOS 7 and 8 each have 50% of market share this solution should be enough.

Plugin I'm using: org.apache.cordova.statusbar

Instead of using StatusBar.hide() I used:

var hideSb = function(){
//        StatusBar.hide;
        cordova.exec(null, null, 'StatusBar', 'hide', ['Ehi', 'You']);
    };

Call it in fn onDeviceReady. And this is based on:

cordova.exec(
    callbackFn,     // A callback function that deals with the JSON object from the CDVPluginResult instance
    errorFn,        // An error handler
    'TargetClass',  // What class to target messages to (method calls = message in ObjC)
    'methodToCall', // Which method to call
    [ 'array', 'of', 'arguments'] // These go in the CDVInvokedUrlCommand instance's.arguments property
);

And I've experienced that wrapping it in a function works and just using it straight away doesn't work at times. Also I'm clueless about the arguments passed!


Post a Comment for "How Can I Get The IOS Status Bar To *overlay* The App Surface Rather Than Pushing It Down?"