简体   繁体   中英

ionic run android shows black and white screens before main app page

I am testing my ionic app on an Android phone using:

 ionic run android 

When the app starts the splash screen shows for a few seconds as expected, and then the screen goes black for @1 second and then white for @2 seconds and then the main app page appears.

Is there any way to prevent the black and white pages appearing? I read somewhere that a black page appears when there is no splash page but I do have a splash page and it appears fine.

Disable splashscreen auto-hiding and hide it from your code when your app is completely ready.

$ionicPlatform.ready(function() {
    navigator.splashscreen.hide();
});

or when using ngCordova :

$ionicPlatform.ready(function() {
    $cordovaSplashscreen.hide();
});

Should be run somehow when your first state is ready, usually it's sufficent to put it into your first state's controller for testing.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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