我正在更新iOS 8的基于Cordova的应用程序。我注意到状态栏存在问题。
第一次启动后,状态栏的位置正确。但是,如果我关闭应用程序并再次打开它,状态栏将消失,因此我的应用程序屏幕顶部有20px的空白。
我在代码中使用的状态栏是:
if ( mobileOS == 'iOS' && Number( mobileOSver.charAt(0) ) >= 7 ) {
document.getElementsByTagName('body')[0].className+=' fix-ios-7-statusbar';
}
fix-ios-7-statusbar类仅向标题添加padding-top:20px。这在iOS 7中很好用,但是在iOS 8中,如果我关闭应用程序,状态栏就会隐藏起来。
请帮我。
最佳答案
我使用状态栏插件。 iOS8中存在问题(请参阅here),但是最新的git commit为我解决了这些问题。试一试。
cordova plugin add https://github.com/apache/cordova-plugin-statusbar.git#5658e7548c813bf7d6102eea4eaa7726b727b18e
我的config.xml具有:
<preference name="StatusBarOverlaysWebView" value="false" />
<preference name="StatusBarBackgroundColor" value="#9BB06B" />
关于ios - Cordova和iOS 8:状态栏处于隐藏状态,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25947352/