使用PhoneGap Build不显示启动画面

时间:2014-02-17 04:50:59

标签: android cordova

当我加载我的应用程序时,不会显示我设置的启动画面。这是我的config.xml文件:

<?xml version="1.0" encoding="UTF-8"?>
        <widget xmlns = "http://www.w3.org/ns/widgets"
            xmlns:gap = "http://phonegap.com/ns/1.0"
            id        = "com.Mobile.test"
            versionCode=""
            version   = "1.0">
            <name>Mobile</name>
            <description>
            </description>
            <author href="www.mobile.net" email="editor@mobile.net">
    SMD
            </author>
            <preference name="phonegap-version" value="3.1.0" />
            <preference name="orientation" value="default" />
            <preference name="fullscreen" value="false" />
            <preference name="target-device" value="universal" />
            <preference name="webviewbounce" value="true" />
            <preference name="prerendered-icon" value="true" />
            <preference name="stay-in-webview" value="true" />
            <preference name="ios-statusbarstyle" value="default" />
            <preference name="detect-data-types" value="true" />
            <preference name="exit-on-suspend" value="false" />
            <preference name="show-splash-screen-spinner" value="true" />
            <preference name="auto-hide-splash-screen" value="true" />
            <preference name="EnableViewportScale" value="true" />
            <preference name="MediaPlaybackRequiresUserAction" value="false" />
            <preference name="AllowInlineMediaPlayback" value="false" />
            <preference name="BackupWebStorage" value="cloud" />
            <preference name="TopActivityIndicator" value="gray" />
            <preference name="KeyboardDisplayRequiresUserAction" value="false" />
            <preference name="HideKeyboardFormAccessoryBar" value="false" />
            <preference name="SuppressesIncrementalRendering" value="false" />
            <preference name="android-minSdkVersion" value="7" />
            <preference name="android-installLocation" value="internalOnly" />
            <preference name="SplashScreenDelay" value="5000" />
            <preference name="ErrorUrl" value=""/>
            <preference name="BackgroundColor" value="0x000000"/>
            <preference name="KeepRunning" value="true"/>
            <preference name="DisallowOverscroll" value="false"/>
            <preference name="LoadingDialog" value=","/> 
            <preference name="LoadUrlTimeoutValue" value="20000" />
            <preference name="disable-cursor" value="false" />
            <gap:platform name="android" />
            <gap:plugin name="org.apache.cordova.geolocation"  />
            <gap:plugin name="org.apache.cordova.inappbrowser"  />
            <gap:plugin name="org.apache.cordova.splashscreen"  />
            <gap:splash src="img/splash/android/ldpi.png" gap:platform="android" gap:density="ldpi" />
            <gap:splash src="img/splash/android/mdpi.png" gap:platform="android" gap:density="mdpi" />
            <gap:splash src="img/splash/android/hdpi.png" gap:platform="android" gap:density="hdpi" />
        </widget>

我也尝试过:

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

标题为“splash”的启动画面和index.html没有运气的根文件夹

启动画面的大小为:

LDPI:
Portrait: 200x320px
Landscape: 320x200px
MDPI:
Portrait: 320x480px
Landscape: 480x320px
HDPI:
Portrait: 480x800px
Landscape: 800x480px

有人可以就如何解决这个问题提出建议吗?我没有在本地包装此应用程序,严格使用 Phone Gap Build。

1 个答案:

答案 0 :(得分:1)

我为我比较了一些项目,我在你的config.xml中实现了Splash画面,我发现你错过了这一行:

<preference name="splash-screen-duration" value="6000" />

和这个插件

<plugin name="SplashScreen" value="org.apache.cordova.SplashScreen"/>

试试这个并喂我回来