2014-10-29 2 views
0

я установил плагин с помощью CLI через это: $ cordova plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-splashscreen.gitЯ не могу сделать SplashScreen работу над Android PhoneGap проекта

Моя Cordova версия: 3.4.0-0.19.17
cordova.js версия моего проекта: 3.4.0

Я выполнил инструкцию в своей документации, но я не могу заставить ее работать. Вот мои Рез каталог:

enter image description here

Вот мои config.xml файлы относительно SplashScreen:

config.xml

<feature name="SplashScreen"> 
    <param name="android-package" value="org.apache.cordova.splashscreen.SplashScreen" /> 
</feature> 

config.xml

<plugin name="SplashScreen" value="org.apache.cordova.SplashScreen"/> 
<platform name="android"> 
    <splash src="www/res/drawable/splashscreen.png" /> 
</platform> 
<preference name="SplashScreen" value="screen" /> 
<preference name="SplashScreenDelay" value="10000" /> 

мое устройство готово функция на index.html:

document.addEventListener("deviceready", onDeviceReady, false); 
    function onDeviceReady() { 
    navigator.splashscreen.show(); 
    redirectTo("./main.html"); 
} 

Что может быть не так?

ответ

1
follow the instructions on the PhoneGap documentation page:           
    http://docs.phonegap/en/3.4.0/config_ref_images.md.html#Icons%20and%20Splash%20Screens 


    The size for each should be: 

    xlarge (xhdpi): at least 960 × 720 
    large (hdpi): at least 640 × 480 
    medium (mdpi): at least 470 × 320 
    small (ldpi): at least 426 × 320 
    Make sure you have these in config.xml: 

    <preference name="SplashScreen" value="screen" /> 
    <preference name="SplashScreenDelay" value="10000" /> 

    then put copies of your splash screen image (each having the correct 
    resolution for the target platform) in the drawable* folders, like this: 

    platforms/android/res/drawable/screen.png 
    platforms/android/res/drawable-hdpi/screen.png 
    platforms/android/res/drawable-ldpi/screen.png 
    platforms/android/res/drawable-mdpi/screen.png 
    platforms/android/res/drawable-xhdpi/screen.png 

    Also, suggest removing this from your config file: 

    <preference name="auto-hide-splash-screen" value="true" /> 
+0

Какой размер платформ/android/res/drawable/screen.png? – clintgh

+0

Размер для каждого должно быть: XLarge (xhdpi): по меньшей мере, 960 × 720 большой (ИПЧР): по меньшей мере, 640 × 480 среда (MDPI): по меньшей мере, 470 × 320 маленький (ldpi): по крайней мере, 426 × 320 –

+0

Да, спасибо, я могу видеть, что на ваш ответ, но то, что я прошу, - это экран по умолчанию screen.png? не hdli/ldpi/mdpi/xhdpi – clintgh

Смежные вопросы