DedrisFrameworkDedrisFramework

← Plugins  /  Splash Screen

🚀

Splash Screen

cordova-plugin-splashscreen
iOS Android

This official Apache Cordova plugin displays and hides the native splash screen shown while your app starts up. You control it from JavaScript — typically hiding it once your first view is ready — and configure its appearance and timing through config.xml preferences.

Installation

terminal
cordova plugin add cordova-plugin-splashscreen

Methods

The plugin is exposed on navigator.splashscreen after deviceready:

MethodDescription
navigator.splashscreen.show()Display the splash screen.
navigator.splashscreen.hide()Dismiss the splash screen.

Preferences (config.xml)

Most of the behaviour is set declaratively in config.xml:

PreferenceDescription
AutoHideSplashScreenIf false, the splash stays up until you call hide() yourself.
SplashScreenDelayHow long (ms) to keep the splash on screen when auto-hide is on.
FadeSplashScreenWhether the splash fades out instead of disappearing instantly.
FadeSplashScreenDurationLength of the fade-out animation in milliseconds.
ShowSplashScreenSpinnerShow a loading spinner over the splash image.

Usage example

Disable auto-hide in config.xml, then hide the splash once your app is ready:

config.xml
<!-- Keep the splash up until JavaScript hides it -->
<preference name="AutoHideSplashScreen" value="false" />
www/js/app.js
document.addEventListener("deviceready", onReady, false);

function onReady() {
  // Render your first screen, then dismiss the splash.
  setTimeout(function () {
    navigator.splashscreen.hide();
  }, 500);
}

Tips

📚 Source: the technical reference on this page (methods and preferences) is based on the official Apache Cordova splash-screen documentation. Descriptions and examples have been rewritten in DedrisFramework's own words. Apache Cordova documentation is published by the Apache Software Foundation under the Apache License 2.0.
← Back to plugins Start a project