问题
I'm using this code to add my Splash Screen in the config file with Phonegap Build:
<gap:splash src="mdpi-logo.9.png" gap:platform="android" gap:qualifier="mdpi" />
<gap:splash src="hdpi-logo.9.png" gap:platform="android" gap:qualifier="hdpi" />
<gap:splash src="xhdpi-logo.9.png" gap:platform="android" gap:qualifier="xhdpi" />
<gap:splash src="xxhdpi-logo.9.png" gap:platform="android" gap:qualifier="xxhdpi" />
But, when I installed my app on Android plataform, It doesn't work, It shows a black screen before it shows the app.
回答1:
If that can help you when I used qualifier instead of density, if I want that the Splash Screen work I have to configure :
<preference name="SplashScreen" value="splash" />
instead of
<preference name="SplashScreen" value="screen" />
回答2:
I had to add this
<platform name="android">
<splash src="www/assets/images/ldpi.png" density="port-ldpi"/>
<splash src="www/assets/images/mdpi.png" density="port-mdpi"/>
<splash src="www/assets/images/hdpi.png" density="port-hdpi"/>
<splash src="www/assets/images/xhdpi.png" density="port-xhdpi"/>
</platform>
and had to scale images exactly to same size as specified at
platforms/android/assets/www/res/screen/android
remember exact size, not ratio.
来源:https://stackoverflow.com/questions/24212966/black-splash-screen-phonegap-build-android