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:
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;Listen to the deviceready event;
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
Written by Tiago Duarte
Related protips
4 Responses
Awesome tip, thanks!
very good tip!
Is it not <preference name="AutoHideSplashScreen" value="false" />
?
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.