honegap构建android应用程序splashscreen

honegap构建android应用程序splashscreen

本文介绍了phonegap构建android应用程序splashscreen不工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是新的phonegap。我有一个问题,我不能弄清楚在过去2周。我使用phonegap构建一个Android应用程序。该应用程序工作正常,但是,启动屏幕不工作。我甚至试图使用mais phonegap测试页,他们的启动屏幕也不会显示...

I'm new to phonegap. I have an issue i couldn't figure it out in the past 2 weeks. I'm using phonegap build for a android app. The app works fine, however, the splash screen is not working. I even tried to use the mais phonegap test page, and their splash screen is not showing as well...

我搜索了所有的foruns,并试图做很多事情...但没有工作...

I've searched in all foruns, and tried to do many things... but none worked...

如果任何人都可以帮助我会喜欢它。这是我的xml文件。

If anyone can help I would appreciate it. Here is my xml file.

 <feature name="http://api.phonegap.com/1.0/device" />
    <preference name="permissions" value="none" />
    <preference name="orientation" value="default" />
    <preference name="target-device" value="universal" />
    <preference name="fullscreen" value="true" />
    <preference name="webviewbounce" value="true" />
    <preference name="prerendered-icon" value="true" />
    <preference name="stay-in-webview" value="false" />
    <preference name="ios-statusbarstyle" value="black-opaque" />
    <preference name="detect-data-types" value="true" />
    <preference name="exit-on-suspend" value="false" />
    <preference name="show-splash-screen-spinner" value="true" />
    <preference name="disable-cursor" value="false" />
    <preference name="android-minSdkVersion" value="7" />
    <preference name="android-installLocation" value="auto" />
    <preference name="SplashScreen" value="screen" />
    <preference name="SplashScreenDelay" value="10000" />
    <icon src="icon.png" />
    <icon gap:density="ldpi" gap:platform="android" src="res/icon/android/icon-36-ldpi.png" />
    <icon gap:density="mdpi" gap:platform="android" src="res/icon/android/icon-48-mdpi.png" />
    <icon gap:density="hdpi" gap:platform="android" src="res/icon/android/icon-72-hdpi.png" />
    <icon gap:density="xhdpi" gap:platform="android" src="res/icon/android/icon-96-xhdpi.png" />
    <gap:splash src="screen/android/screen-ldpi-portrait.png" gap:platform="android" gap:density="ldpi" />
    <gap:splash src="screen/android/screen-mdpi-portrait.png" gap:platform="android" gap:density="mdpi"  />
    <gap:splash src="screen/android/screen-hdpi-portrait.png" gap:platform="android" gap:density="hdpi"  />
    <gap:splash src="screen/android/screen-xhdpi-portrait.png" gap:platform="android" gap:density="xhdpi"  />
    <gap:splash src="splash.png" />

    <access origin="*" />


推荐答案

我有这些设置, / p>

I have these settings and they are now working:

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

<platform name="android">
    <!-- you can use any density that exists in the Android project -->
    <splash src="res/drawable-land-hdpi/screen.png" density="land-hdpi"/>
    <splash src="res/drawable-land-ldpi/screen.png" density="land-ldpi"/>
    <splash src="res/drawable-land-mdpi/screen.png" density="land-mdpi"/>
    <splash src="res/drawable-land-xhdpi/screen.png" density="land-xhdpi"/>

    <splash src="res/drawable-port-hdpi/screen.png" density="port-hdpi"/>
    <splash src="res/drawable-port-ldpi/screen.png" density="port-ldpi"/>
    <splash src="res/drawable-port-mdpi/screen.png" density="port-mdpi"/>
    <splash src="res/drawable-port-xhdpi/screen.png" density="port-xhdpi"/>
</platform>

<icon src="icon.png" />
<icon gap:density="ldpi" gap:platform="android" src="res/drawable-hdpi/icon.png" />
<icon gap:density="mdpi" gap:platform="android" src="res/drawable-ldpi/icon.png" />
<icon gap:density="hdpi" gap:platform="android" src="res/drawable-mdpi/icon.png" />
<icon gap:density="xhdpi" gap:platform="android" src="res/drawable-xhdpi/icon.png" />

请注意,res / drawable ......文件夹应该在应用程序级根文件夹

Please note that res/drawable...... folders should be in you App level root folder with images and they will be copied automatically to platform folders.

希望有帮助。

这篇关于phonegap构建android应用程序splashscreen不工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-04 21:20