Cordova Hide Status Bar

牧云@^-^@ 提交于 2019-12-05 03:23:06

After some long hours of debugging, I finally figured out what the issue was.

In fact, the status bar was hidden, and the white bar we would see is the overlay provided by Framework7, which explains the following:

StatusBar.isVisible // false

Apparently Framework7 is hiding the status bar, but leaving a blank white bar on top of the application, which is a padding.

So to remove the bar, I had to remove the class with-statusbar-overlay from the html tag. And to do so, I added the following to my Javascript file:

document.documentElement.classList.remove('with-statusbar-overlay');

Note that the Javascript fix must be executed before the deviceready event. Otherwise, you will see the home view with the bar, then the bar will disappear. If you put it before the event, the user will never see the bar.

document.documentElement.classList.remove('with-statusbar-overlay');

Dom7(document).on('deviceready', function(){
    // Your code
});
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!