Add splash Start Page to your Cordova Hybridapp

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.