本文介绍了iOS Statusbar叠加电话间隙的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用PhoneGap(Cordova)开发iOS应用,而我的问题是状态栏覆盖了我的Web视图/应用程序:
I'm developing iOS app with PhoneGap (Cordova) and my problem is that status bar is overlaying my webview/application:
我已经在config.xml文件中添加了首选项,但是这些首选项不起作用:
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" />
我该如何解决?
推荐答案
通过以下方式解决:安装了cordova-plugin-statusbar之后,将此行添加到config.xml中:
Solved this way:With cordova-plugin-statusbar installed, added this line to config.xml:
<gap:plugin name="com.phonegap.plugin.statusbar" />
,然后在index.html中:
and then in index.html:
<script type="text/javascript">
document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady(){
StatusBar.overlaysWebView(false);
}
</script>
这篇关于iOS Statusbar叠加电话间隙的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!