Last Updated: February 25, 2016
·
3.617K
· tmpduarte

Control Phonegap Splash Screen hiding

When building a Phonegap web based app you might want to control when your splash screen disappears.

For instance you might have heavy javascript loading or long image loading times and you just want to allow the user to use the app after everything is ready so that he doesn't experience any user experience quirks.

Phonegap provides a solution for this:

  1. In your config.xml file add: <preference name="AutoHideSplashScreen" value="false" />. This will prevent the hiding of the splash screen by itself and it will remain on screen indefinitely;

  2. Listen to the deviceready event;

  3. After the event is fired and at the point you think the app is ready to use just call navigator.splashscreen.hide();. This will make the splash screen go away and allow the user to use the app;

ps.: This tip doesn't intend to explain how to add a splash screen to your app, for that you can check Phonegap configuration

4 Responses
Add your response

Awesome tip, thanks!

over 1 year ago ·

very good tip!

over 1 year ago ·

Is it not <preference name="AutoHideSplashScreen" value="false" />?

over 1 year ago ·

Thanks @leecrossley, it's interesting because I was using this feature exactly as I posted on July/August and it was working.
I also ran a quick search and all the websites point to your solution. If possible I'm going to amend my post.

Thanks again for the tip.

over 1 year ago ·