简体   繁体   English

科尔多瓦android启动画面不会与内容交叉淡入淡出

[英]Cordova android splash screen not cross fading with content

I have a minor problem, i'm trying to make the splash screen cross fade with the content of my android app. 我有一个小问题,我正在尝试使闪屏与我的Android应用程序的内容交叉消失。 The splash screen is fading to grey and than suddenly 'jumps' to my startpage. 初始屏幕逐渐变成灰色,然后突然“跳到”我的首页。 I would like the splash screen to gradually become more transparant, showing my startpage content. 我希望初始屏幕逐渐变得透明,以显示我的首页内容。

I used the following settings in my config.xml 我在config.xml中使用了以下设置

    <preference name="AutoHideSplashScreen" value="true" />
    <preference name="SplashScreenDelay" value="3000" />
    <preference name="SplashMaintainAspectRatio" value="true" />
    <preference name="SplashShowOnlyFirstTime" value="true" />
    <preference name="ShowSplashScreenSpinner" value="false" />  
    <preference name="FadeSplashScreen" value="true" />  
    <preference name="FadeSplashScreenDuration" value="1000" />

You can give the Apache's splashscreen-Plugin a try. 您可以尝试使用Apache的启动画面插件。

Fortunately there are less preferences necessary in your config.xml: 幸运的是,您的config.xml中的偏好设置更少:

<preference name="SplashScreen" value="screen"/>
<preference name="AutoHideSplashScreen" value="false" />
<preference name="FadeSplashScreenDuration" value="750"/>

<plugin name="org.apache.cordova.splashscreen"/>

But because of AutoHideSplashScreen set to false you have to remove the SplashScreen yourself: 但是由于AutoHideSplashScreen设置为false,因此您必须自己删除SplashScreen:

document.addEventListener('deviceready', function(){

  navigator.splashscreen.show();

  setTimeout(function(){
    navigator.splashscreen.hide();
  },1000);

}, false);

Hope this helps. 希望这可以帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM