Status Bar Hide Cordoba

If I delete the status bar, every time I open the keyboard (or a notification arrives) there is an error.

App.run(function($ionicPlatform) { $ionicPlatform.ready(function() { if(window.StatusBar) { StatusBar.hide(); } }); }); 

enter image description here Image1

Any suggestion? Thanks!

+6
source share
1 answer

Updated:

In fact, there is a fix for the cordova-plugin-statusbar line that was fixed on github and should land in version 2.1.4 + (i.e. you don't need an additional plugin, like my original answer). To get the last line with the plugin plugin , enter

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

The status bar should now remain hidden when interacting with inputs, keyboard, etc.

Original answer:

I installed it using the cordova-plugin-fullscreen plugin

 cordova plugin add cordova-plugin-fullscreen 

Then, after deviceready :

 StatusBar.hide(); if (typeof AndroidFullScreen !== 'undefined') { // Fullscreen plugin exists ? function errorFunction(error) { console.error(error); } AndroidFullScreen.isSupported(AndroidFullScreen.immersiveMode, errorFunction); } 

ImmersiveMode keeps it hidden when interacting with inputs, keyboard, etc.

Note: according to the cordova-plugin-fullscreen docs , this method is only supported in Android 4.4 + . There is also a β€œlean mode" for Android 4.0+, but it shows a status bar during interaction (not perfect).

+8
source

All Articles