【发布时间】:2014-08-05 19:48:25
【问题描述】:
我想在我的 iOS 版 Phonegap Build 应用程序中延迟启动画面(并避免白色闪烁)。并将其放在我的 config.xml 中:
<gap:splash src="splash.png" width="640" height="960" />
<preference name="AutoHideSplashScreen" value="false" />
<gap:plugin name="org.apache.cordova.splashscreen" />
<preference name="FadeSplashScreen" value="true" />
<preference name="SplashScreenDelay" value="1000" />
(“SplashScreenDelay”无效)。我知道我还必须在我的 index.html 中添加这样的内容:
function onDeviceReady() {
setTimeout(function () {navigator.splashscreen.hide()},4000);
}
但我不知道如何将它与我现有的 index.html 结合起来,它的主体看起来像这样:
<body>
<div id="fb-root"></div>
<canvas id="c2canvas" width="640" height="960">
<h1>Your browser does not appear to support HTML5. Try upgrading your browser to the latest version. <a href="http://www.whatbrowser.org">What is a browser?</a>
<br/><br/><a href="http://www.microsoft.com/windows/internet-explorer/default.aspx">Microsoft Internet Explorer</a><br/>
<a href="http://www.mozilla.com/firefox/">Mozilla Firefox</a><br/>
<a href="http://www.google.com/chrome/">Google Chrome</a><br/>
<a href="http://www.apple.com/safari/download/">Apple Safari</a><br/>
<a href="http://www.google.com/chromeframe">Google Chrome Frame for Internet Explorer</a><br/></h1>
</canvas>
<script src="jquery-2.0.0.min.js"></script>
<script src="phonegap.js"></script>
<script src="c2runtime.js"></script>
<script>
jQuery(window).resize(function() {
cr_sizeCanvas(jQuery(window).width(), jQuery(window).height());
});
document.addEventListener("deviceready", function ()
{
// Create new runtime using the c2canvas
cr_createRuntime("c2canvas");
document.addEventListener("pause", function() {
cr_setSuspended(true);
}, false);
document.addEventListener("resume", function() {
cr_setSuspended(false);
}, false);
}, false);
</script>
</body>
【问题讨论】:
标签: ios cordova splash-screen