在应用程序中加载和切换屏幕时,手机屏幕会闪烁白屏。如何删除白屏?
我的config.xml
<description>
A sample Apache Cordova application that responds to the deviceready event.
</description>
<access origin="*"/>
<content src="index.html" />
<!--
<preference name="splashscreen" value="resourceName" />
<preference name="backgroundColor" value="0x000" />
<preference name="loadUrlTimeoutValue" value="100" />
<preference name="InAppBrowserStorageEnabled" value="true" />
<preference name="disallowOverscroll" value="true" />
-->
<plugins>
<plugin name="SplashScreen" value="org.apache.cordova.SplashScreen"/>
</plugins>
我的index.html
<head>
<script type="text/javascript" charset="utf-8" src="js/cordova-2.9.0.js"></script>
<script type="text/javascript" charset="utf-8">
document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady(){navigator.splashscreen.hide();}
</script>
</head>
<body>
<div id="centercol">
<div id="center" align="center">
<form>
<button class="chapters" formaction="chapters.html">chapters</button>
</form>
</div>
</div>
</body>
答案 0 :(得分:0)
在打开应用时,使用样式和加载资源渲染视图总是需要一些时间。要在切换屏幕上避免这种情况,您应该创建单页应用程序,以便所有资源都可以加载一次