在我的第一个Ionic项目上工作 .
我对启动画面没有任何问题 - 我可以使用CordovaSplashscreen插件并告诉它隐藏()当相关的承诺解决;我也可以注释掉隐藏,而只是依赖于在config.xml中使用AutoHideSplashScreen,并且在SplashScreenDelay之后让启动画面自动隐藏 .
(我列出了这些 do 工作的东西,所以很明显我的问题不是几十个与Ionic和Cordova / PhoneGap相关的闪屏问题的重复 . )
我的问题是,无论我尝试什么 - ios,android,模拟器,真实设备,使用CordovaSplashscreen隐藏()或不,AutoHideSplashScreen设置为true,AutoHideSplashScreen设置为false等 - 我无法得到启发当它消失时,屏幕显示为 fade .
FadeSplashScreen seems not to have any effect no matter what combination of config.xml settings, splash screen hide() calling or not calling, emulation or device, ios or android I use.
我当前的config.xml设置,虽然这并没有提供我尝试过的十几个这些值的完整描述:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<widget id="com.ionicframework.yourkids381244" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
... other code at same level of hierarchy omitted ...
<preference name="SplashScreen" value="screen"/>
<preference name="AutoHideSplashScreen" value="false"/>
<preference name="auto-hide-splash-screen" value="false"/>
<preference name="ShowSplashScreenSpinner" value="false"/>
<preference name="SplashScreenDelay" value="10000"/>
<preference name="FadeSplashScreen" value="true"/>
<preference name="FadeSplashScreenDuration" value="3.0"/>
... other code at same level of hierarchy omitted ...
</widget>
来自我的app.js路由的代码执行hide(),但是,这似乎不是问题的一部分;它工作,我通过注释hide()行并将AutoHideSplashScreen设置为false来确认,这成功地导致启动屏幕永远不会隐藏;但是从那个状态,我无法隐藏淡出闪屏,无论是通过取消注释hide()行来隐藏使用CordovaSplashscreen,还是将AutoHideSplashScreen设置为true .
.state('app.main', {
url: "/main",
views: {
'menuContent': {
templateUrl: "templates/main.html",
controller: ['$scope', '$timeout', '$ionicGesture',
function($scope, $timeout, $ionicGesture) {
$scope.$on('$ionicView.loaded', function() {
ionic.Platform.ready( function() {
$timeout(function() {
if(navigator && navigator.splashscreen) {
// note that this works fine, except for the fading
navigator.splashscreen.hide();
}
}, 500);
});
});
}],
}
}
})
(期待有关此事的评论不涉及承诺的解决,这是在其他地方完成然后app.main被提出......重点是,隐藏这种方式确实有效,它只是没有 fade )
有什么想法可以试试吗?
2 回答
尝试删除config.xml中包含splashcreen值的所有首选项 . 这是我完整的config.xml首选项列表:
删除这些闪屏画面线会导致重置默认值 . 所以闪屏应该褪色 .
它似乎是一个启动屏幕Cordova插件的错误,似乎已经解决:https://issues.apache.org/jira/browse/CB-8875 .