Search code examples
cordovaibm-mobilefirstsplash-screen

how to replace the default splash screen


I have Cordova app that I create with the command --> cordova create MyProject --template cordova-template-mfp.

Where do I put my own icon and splash screen?. I tried to replace the splash screen in the res folder but I still see the IBM screen.

I have the cordova-plugin-splashscreen 3.2.2 "" installed and this is a snippet of my folder structure

MyProject

-- res

-- hooks

-- platform

---- android

---- iOS

Thanks for your help


Solution

  • See here: https://mobilefirstplatform.ibmcloud.com/tutorials/en/foundation/8.0/application-development/cordova-apps/adding-images-and-icons/

    If you used the MobileFirst template when you created your app, you must update the splash images that Cordova uses. Change the source paths and file names (src) to the path of the files that you want to display. Add lines similar to the following example between the <platform name="android"> and </platform> tags in the config.xml file:

    <splash density="land-hdpi" src="res/screen/android/screen-hdpi-landscape.png" />  
    <splash density="land-ldpi" src="res/screen/android/screen-ldpi-landscape.png" />  
    <splash density="land-mdpi" src="res/screen/android/screen-mdpi-landscape.png" />  
    <splash density="land-xhdpi" src="res/screen/android/screen-xhdpi-landscape.png" />  
    <splash density="hdpi" src="res/screen/android/screen-hdpi-portrait.png" />  
    <splash density="ldpi" src="res/screen/android/screen-ldpi-portrait.png" />  
    <splash density="mdpi" src="res/screen/android/screen-mdpi-portrait.png" />  
    <splash density="xhdpi" src="res/screen/android/screen-xhdpi-portrait.png" />