简体   繁体   中英

Phonegap Android splash screen not showing

I'm building a iOS and Android app (with ionic framework and Adobe Phonegap Build), but can't seem to get the splash screens showing up in Android here's my config.xml:

<gap:plugin name="org.apache.cordova.splashscreen" version="0.3.4" />
<preference name="show-splash-screen-spinner" value="true" />
<preference name="auto-hide-splash-screen" value="true" />
<preference name="SplashScreen" value="screen" />
<preference name="SplashScreenDelay" value="1000" />

<gap:splash gap:platform="android" gap:qualifier="port-ldpi" src="icons/splashscreen/port-ldpi.png" />
<gap:splash gap:platform="android" gap:qualifier="port-mdpi" src="icons/splashscreen/port-mdpi.png" />
<gap:splash gap:platform="android" gap:qualifier="port-hdpi" src="icons/splashscreen/port-hdpi.png" />
<gap:splash gap:platform="android" gap:qualifier="port-xhdpi" src="icons/splashscreen/port-xhdpi.png" />
<gap:splash gap:platform="android" gap:qualifier="port-xxhdpi" src="icons/splashscreen/port-xxhdpi.png" />

The splash screen images are sizes like this:

port-ldpi.png = 240x320
port-mdpi.png = 320x480
port-hdpi.png = 480x800
port-xhdpi.png = 720x1280
port-xxhdpi.png = 1280x1920

The path to the images are correct. On iOS it working without any problems.

Any suggestions how to solve this problem? :S

You don't have the default splash tag which is

<gap:splash src="splash.png" />

It's in the documentation: http://docs.build.phonegap.com/en_US/configuring_icons_and_splash.md.html#Icons%20and%20Splash%20Screens

You can look at my example demos. https://github.com/jessemonroy650/Phonegap-Splashscreen-Test It works for both Android and iOS. Implemenation notes are included. NOTE: AndroidManifest.xml is NOT needed.

Also the splash image MUST be the correct size or at least the correct size ratio so it can stretch it. Example:320x240 will work for 640x480, etc. Otherwise, you need to use a 9-patch image . I have not tested 9-patch.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM