Search code examples
ioscordovaphonegap-plugins

iOS statusbar overlay phonegap


I'm developing iOS app with PhoneGap (Cordova) and my problem is that status bar is overlaying my webview/application:

enter image description here

I've added preferences in my config.xml file but these are not working:

<preference name="StatusBarOverlaysWebView" value="false" />
<preference name="StatusBarBackgroundColor" value="#0ff000" />
<preference name="StatusBarStyle" value="default" />

How can i solve that?


Solution

  • Solved this way: With cordova-plugin-statusbar installed, added this line to config.xml:

    <gap:plugin name="com.phonegap.plugin.statusbar" />
    

    and then in index.html:

    <script type="text/javascript">
            document.addEventListener("deviceready", onDeviceReady, false);
    
            function onDeviceReady(){
                StatusBar.overlaysWebView(false);
            }
    </script>