Search code examples
angularjsionic-frameworksplash-screen

Show ionic Splashscreen manually


Normally the Splashscreen is displayed when the apps starts.

In my app I check if the user is logged in in the beginning. I want to display the Splashscreen manually until the check is over.

1 Is it possible to show the Splashscreen manually and if yes how?

2 There are Splashscreen-images for every device size. Is it possible to make an ion-view to show the right image in fullscreen?


Solution

  • 1.You can Control the Splash Screen time interval by using below code,

    app.run(function($cordovaSplashscreen) {
      setTimeout(function() {
        $cordovaSplashscreen.hide()
      }, 5000)
    })
    

    2.Using ionic CLI,you can generate splash screens automatically from source images to create each size needed for each platform.There is no need of copying each resized and cropped image into each platform's resources directory.

    Save a splash.png, splash.psd or splash.ai file within the resources directory at the root of the Cordova project. The source image's minimum dimensions should be 2208x2208 px.Additionally, when the Orientation preference config is set to either landscape or portrait mode, then only the necessary images will be generated.

    $ ionic resources --splash
    

    Refer