以下Phonegap项目(Phonegap Build)无效:
config.xml中:
<preference name="AutoHideSplashScreen" value="false" />
<preference name="SplashScreenDelay" value="10000"/>
<gap:plugin name="org.apache.cordova.splashscreen" />
指数:
<head>
<script type="text/javascript" charset="utf-8">
window.location = 'http://www.example.com/login';
document.AddEventListener("deviceready", OnDeviceReady, false);
function OnDeviceReady() {
setTimeout(function() {
navigator.splashscreen.hide();
}, 6000);
};
</script>
</head>
启动画面始终保持加载状态。重定向到主页不起作用。
我试过这个: PhoneGap Build iOS app has blank white screen after splash screen
此: http://community.phonegap.com/nitobi/topics/splash_screen_autohidesplashscreen_false_not_working_iphone_ios7(插件版本0.2.3)
什么都没有用。有什么想法吗?
答案 0 :(得分:3)
启动画面插件不支持Android的AutoHideSplashScreen
。另请参阅此问题:https://issues.apache.org/jira/browse/CB-8396。
至于重定向不起作用,请尝试window.location.href = 'http://www.example.com/login';
答案 1 :(得分:3)
快进到2016年:这是刚刚实施的。您需要04-14 11:52:54.592 1300-1354/? I/ActivityManager: START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.example.xxx.myapplication3/com.example.xxx.myapplication.MainActivity (has extras)} from uid 10014 on display 0
04-14 11:52:54.673 1300-1635/? I/ActivityManager: START u0 {act=android.content.pm.action.REQUEST_PERMISSIONS pkg=com.android.packageinstaller cmp=com.android.packageinstaller/.permission.ui.GrantPermissionsActivity (has extras)} from uid 10057 on display 0
(2016年2月发布)
请参阅https://github.com/apache/cordova-plugin-splashscreen/pull/74
答案 2 :(得分:-1)
如果您要停用启动画面,则应在http://www.example.com/login
的正文中添加onDeviceReady