如何删除离子屏幕中出现的白色空白页?

时间:2016-03-10 06:32:11

标签: ionic-framework

我正在开发一个离子框架项目。当我启动应用程序时,会有一个启动画面登录。当我登录时,有一段时间会出现一个白色的空白屏幕,然后会显示下一个视图。我想删除那个白色的空白屏幕。任何帮助将不胜感激。

3 个答案:

答案 0 :(得分:2)

我尝试了许多版本的cordova-plugin-splashscreen,我发现版本2.0.0非常完美。请试一试,问候:

cordova plugin add cordova-plugin-splashscreen@2.0.0

答案 1 :(得分:1)

安装启动画面

cordova plugin add https://github.com/apache/cordova-plugin-splashscreen.git

并在config.xml中设置以下首选项

<preference name="SplashScreen" value="screen"/>
<preference name="SplashScreenDelay" value="2000"/>
<preference name="AutoHideSplashScreen" value="false"/>
<preference name="ShowSplashScreenSpinner" value="true"/>
<preference name="SplashShowOnlyFirstTime" value="false"/>
<preference name="FadeSplashScreenDuration" value="1000"/>

答案 2 :(得分:0)

您还可以使用setTimeout函数以编程方式隐藏启动画面: 以前需要设置:

function minMax(items) {
    return items.reduce(
        (accumulator, currentValue) => {
            return [
                Math.min(currentValue, accumulator[0]), 
                Math.max(currentValue, accumulator[1])
            ];
        }, [Number.MAX_VALUE, Number.MIN_VALUE]
    );
}

然后:

<preference name="AutoHideSplashScreen" value="false"/>

}

相关问题