2016-03-10 70 views

回答

1

在config.xml安裝閃屏

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

,並設置以下首

<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"/> 
0

你也可以使用一個setTimeout函數以編程方式隱藏啓動畫面: 以前您需要設置:

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

然後:

initializeApp() { 
this.platform.ready().then(() => { 
    // Okay, so the platform is ready and our plugins are available. 
    // Here you can do any higher level native things you might need. 
    this.statusBar.styleDefault(); 
    setTimeout(() => { 
    this.splashScreen.hide(); 
    }, 3000); 
}); 

}