我目前正在开发Ionic2应用程序。我面临一个问题,在闪屏后,在应用程序主屏幕之前,会有6-7秒的白屏。
我试着用谷歌搜索了一下,但是什么都没用。我要解决的最后一个问题是
hideSplashScreen() {
if(Splashscreen){
setTimeout(() => {
Splashscreen.hide();
},100)
}
};//
<preference name="SplashMaintainAspectRatio" value="true"/>
<preference name="FadeSplashScreenDuration" value="300"/>
请在这个问题上帮助我;
编辑::My ionic info
is
Cordova CLI: 6.4.0
Ionic Framework Version: 2.0.0-rc.4
Ionic CLI Version: 2.1.17
Ionic App Lib Version: 2.1.7
Ionic App Scripts Version: 0.0.47
ios-deploy version: 1.8.6
OS: OS X El Capitan
Node Version: v6.3.1
Xcode version: Xcode 7.2 Build version 7C68
发布于 2017-11-28 10:19:15
在执行以下任意CLI命令时添加--prod标记:
// If iOS
ionic emulate ios --prod
ionic build ios --prod
ionic run ios --prod
// If Android
ionic emulate android --prod
ionic build android --prod
ionic run android --prod
有关为给定平台https://ionicframework.com/docs/cli/cordova/build/构建(准备+编译)离子项目的更多信息
发布于 2018-04-12 00:20:21
我已经通过在config.xml上设置正确的参数解决了这个问题
<preference name="AutoHideSplashScreen" value="false" />
<preference name="SplashScreenDelay" value="10000" />
<preference name="FadeSplashScreenDuration" value="1000" />
<preference name="SplashScreen" value="screen" />
<preference name="ShowSplashScreen" value="true" />
<preference name="ShowSplashScreenSpinner" value="false" />
<preference name="SplashShowOnlyFirstTime" value="false" />
<preference name="FadeSplashScreen" value="true" />
然后,在我的platform.ready()指令中,我所做的就是Splashscreen.hide();
https://stackoverflow.com/questions/41544016
复制相似问题