【发布时间】:2016-02-27 04:10:30
【问题描述】:
这是我的 android 和 IOS 应用程序的问题,我真的不知道如何解释,但基本上我将启动画面延迟了 12 秒,之后我得到 然后白屏大约 2 秒然后应用程序呈现。正确地,我尝试将启动屏幕延迟 20 毫秒,以查看应用程序是否运行速度太慢,但事实并非如此。这是代码
config.xml
<preference name="AutoHideSplashScreen" value="false"/>
<preference name="ShowSplashScreenSpinner" value="false"/>
<preference name="FadeSplashScreen" value="true" />
<preference name="SplashScreenDelay" value="12000" />
<preference name="FadeSplashScreenDuration" value="1.0" />
** 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>
任何想法为什么会发生这种情况?以及如何解决这个问题?我有谷歌并尝试不同的解决方案,但仍然是同样的问题。我感觉它是 iframe,但我怎么还能使用 iframe 来做到这一点?
【问题讨论】:
-
您知道Google and Apple frown on apps 都是网站包装器吗?
-
@JesseMonroy650 “如果您仔细阅读,请提供不归您所有或管理的网站的网页视图(除非您获得网站所有者/管理员的许可)”你会看到它说
not owned我不拥有“example.com”,但我拥有相关网站 -
好的@James。我这样做的目的是让开发人员免于在开发应用程序上工作数周和数月的心痛 - 只是为了把它扔掉。您想要关于这个确切主题(您的问题)的教程(带有源代码)吗?
-
@JesseMonroy650 是的,如果可能的话,请
标签: android ios cordova iframe phonegap-build