【发布时间】:2016-02-28 11:48:53
【问题描述】:
我在延迟 IOS 和 Android 上的启动画面时遇到问题,并且只有在 InAppBroswer 完成后才将其删除。这是我尝试过的逻辑
config.xml
<preference name="splashScreenDelay" value="10000" />
<preference name="AutoHideSplashScreen" value="false" />
index.html
<html>
<head>
<title>Example App</title>
<meta charset="utf-8">
<link href="css/index.css" rel="stylesheet" type="text/css">
</head>
<script src="cordova.js" type="text/javascript" ></script>
<script src="js/main.js" type="text/javascript"></script>
<script type="text/javascript" charset="utf-8">
// Wait for device API libraries to load
//
document.addEventListener("deviceready", onDeviceReady, false);
// Global InAppBrowser reference
var iabRef = null;
function onDeviceReady() {
iabRef = window.open('https://www.example.com/app', '_self', 'location=no,toolbar=no');
iabRef.addEventListener('loadstop', function() {
navigator.splashscreen.hide();
});
document.addEventListener("backbutton", function (e) {
e.preventDefault();
}, false );
}
</script>
<body>
<iframe src="https://www.example.com/app" style="width:100%; height:100%;">
</body>
</html>
闪屏显示片刻,然后白屏大约 5 秒。
索引中的逻辑是在 inAppBroswer 完成加载(loadstop) 后隐藏启动画面,但这似乎不起作用。
请有任何想法。
console.log(导航器)
【问题讨论】:
标签: cordova phonegap-plugins phonegap-build splash-screen inappbrowser