Patrick
Patrick

Reputation: 39

Cordova and iOS 8 : the statusbar is hidden

I'm updating my Cordova-based application for iOS 8. I notice an issue with the status bar.

The status bar is positioned correctly after the first launch. But if I close the application and open it again, the status bar dissappears, so I have a blank gap of 20px in the top of my app screen.

What I use in my code for the status bar is :

    if ( mobileOS == 'iOS' && Number( mobileOSver.charAt(0) ) >= 7 ) {
        document.getElementsByTagName('body')[0].className+=' fix-ios-7-statusbar';
    }  

The class fix-ios-7-statusbar simply adds a padding-top:20px to the header. This works in iOS 7 very well, but in iOS 8 I have an issue with the status bar that is hidden if I close the app.

Please help me.

Upvotes: 1

Views: 2050

Answers (1)

cobberboy
cobberboy

Reputation: 6225

I use the statusbar plugin. There were issues in iOS8 (see here), but the latest git commit fixed those for me. Give it a try.

cordova plugin add https://github.com/apache/cordova-plugin-statusbar.git#5658e7548c813bf7d6102eea4eaa7726b727b18e

My config.xml has this:

    <preference name="StatusBarOverlaysWebView" value="false" />
    <preference name="StatusBarBackgroundColor" value="#9BB06B" />

Upvotes: 3

Related Questions