Black splash screen - Phonegap Build (Android)

时光怂恿深爱的人放手 提交于 2019-12-25 04:08:23

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!