1

I added splash.png to default root(with index.html path) Then I added splash plugin to config.xml

<preference name="phonegap-version" value="cli-6.3.0" />
<preference name="SplashScreenDelay" value="5000" />
<plugin name="cordova-plugin-splashscreen" source="npm" />
<splash src="splash.png" />

What is wrong with this?Why it does not show my splash.png?It shows phonegap default splash icon

user1688401
  • 1,851
  • 8
  • 47
  • 83

1 Answers1

1

Splash screens are notoriously tricky to get right. I've always had issues when only using the one "splash.png" image, so I recommend sizing one splash screen for your current device, then add in the others. Leverage the following sizes, making sure that the folder structure and image dimensions match exactly. Otherwise, the default PhoneGap one will display instead.

NOTE: The folder paths do not have to be the following: "splash/ios". Same with the file names such as "Default-568h@2x~iphone.png" - you can name them anything you want, as long as the actual filename matches!

<!-- iPhone 5 / iPod Touch (5th Generation) -->
<splash src="splash/ios/Default-568h@2x~iphone.png" platform="ios" width="640" height="1136" />

<!-- iPhone 6 -->
<splash src="splash/ios/Default-667h.png" platform="ios" width="750" height="1334" />
<splash src="splash/ios/Default-736h.png" platform="ios" width="1242" height="2208" />
<splash src="splash/ios/Default-Landscape-736h.png" platform="ios" width="2208" height="1242" />

<!-- iPad -->
<splash src="splash/ios/Default-Portrait~ipad.png" platform="ios" width="768" height="1024" />
<splash src="splash/ios/Default-Landscape~ipad.png" platform="ios" width="1024" height="768" />

<!-- Retina iPad -->
<splash src="splash/ios/Default-Portrait@2x~ipad.png" platform="ios" width="1536" height="2048" />
<splash src="splash/ios/Default-Landscape@2x~ipad.png" platform="ios" width="2048" height="1536" />
dotNetkow
  • 5,053
  • 4
  • 35
  • 50
  • There is just iphone 5 and iphone 6 in your code.What about iphone 7 or other devices?especially android has many different size..I want to use just one splash.png for all devices – user1688401 May 01 '17 at 17:53
  • The "iPhone 6" dimensions are the same for 7. See here: http://cordova.apache.org/docs/en/6.x/reference/cordova-plugin-splashscreen/index.html. For Android and all others, consult the official docs: http://docs.phonegap.com/phonegap-build/configuring/icons-and-splash/. Apologies if my answer wasn't clear: even though the PhoneGap Build docs mention just using one file, I've never got that to work, hence my answer to specify each dimension. – dotNetkow May 01 '17 at 20:40