Now the latest version of Cordova 3 supports the splash screen, which is implemented by the Cordova plugin.
Currently splash plug-ins support Android,ios,blackberry and many other platforms.
The process of adding plugins is as follows:
Add SplashScreen Plugin
Run in the Cordova project directory:
Cordova Plugin Add Org.apache.cordova.splashscreen
This command downloads the plugin code from the plugin git library to the project's plugins directory
To modify the config configuration file
<preference name= "SplashScreen" value= "screen"/> <!--file name without suffix png, default is screen--> <preference name= "Splashscreendelay" value= "/>" <!--splash display time, default is 3000ms--> <feature name= "SplashScreen" > <param name= "android-package" value= "Org.apache.cordova.splashscreen.SplashScreen"/> </feature >
Modify the boot picture can see the name of the startup picture is Screen.png, the project has some screen.png default picture, the above is shown is the Cordova logo, the following need to change these images to your own start screen, do not need to support the size of the image directly deleted on it.
Hide splash screen After device initialization is complete
Document.addeventlistener ("Deviceready", Ondeviceready, false); function Ondeviceready () { navigator.splashscreen.hide (); }
If you use the Ionic framework, add the. Run ([' $ionicPlatform ', function ($ionicPlatform) {...} directly in the App.js file.
Navigator.splashscreen.hide ();
You can do it.
Now run your app again and you should see the splash screen.
Add splash Start Page to your Cordova Hybridapp