【问题标题】:Cordova 5.1.1 Splashscreen not workingCordova 5.1.1 启动画面不工作
【发布时间】:2015-07-13 15:53:38
【问题描述】:

我正在尝试在我的 Android 设备(Redmi 1S,Android 版本 4.4.4 KTU84P)上运行启动画面。该应用程序在我的设备上运行良好,但没有出现启动画面。启动画面图像被复制并重命名为“screen.png”到相应的“platforms\android\res\drawable*”目录中。我还没有为科尔多瓦安装任何闪屏插件。下面是项目根目录下config.xml的内容。

<?xml version='1.0' encoding='utf-8'?>
<widget id="com.victor.workshop" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
    <name>Workshop</name>
    <description>
        A sample Apache Cordova application that responds to the deviceready event.
    </description>
    <author email="dev@cordova.apache.org" href="http://cordova.io">
        Apache Cordova Team
    </author>
    <content src="index.html" />
    <plugin name="cordova-plugin-whitelist" version="1" />
    <access origin="*" />
    <allow-intent href="http://*/*" />
    <allow-intent href="https://*/*" />
    <allow-intent href="tel:*" />
    <allow-intent href="sms:*" />
    <allow-intent href="mailto:*" />
    <allow-intent href="geo:*" />   

    <platform name="android">
        <allow-intent href="market:*" />
        <icon src="res/android/icons/xhdpi.png"/>
        <icon src="res/android/icons/ldpi.png" density="ldpi" />
        <icon src="res/android/icons/mdpi.png" density="mdpi" />
        <icon src="res/android/icons/hdpi.png" density="hdpi" />
        <icon src="res/android/icons/xhdpi.png" density="xhdpi" />

        <splash src="res/android/splashscreens/land-hdpi.png" density="land-hdpi"/>
        <splash src="res/android/splashscreens/land-ldpi.png" density="land-ldpi"/>
        <splash src="res/android/splashscreens/land-mdpi.png" density="land-mdpi"/>
        <splash src="res/android/splashscreens/land-xhdpi.png" density="land-xhdpi"/>

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


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

</widget>

任何帮助或指针表示赞赏。提前致谢。

【问题讨论】:

    标签: android cordova splash-screen


    【解决方案1】:

    从cordova android 4.0开始需要启动屏幕插件来显示启动屏幕

    重大变化

    现在通过插件提供启动画面功能

    您需要添加新的 cordova-plugin-splashscreen 插件才能继续使用闪屏

    https://cordova.apache.org/announcements/2015/04/15/cordova-android-4.0.0.html

    所以,安装它

    cordova plugin add cordova-plugin-splashscreen
    

    然后一切都应该正常工作

    【讨论】:

    • 非常感谢,我的错,应该尝试安装它。
    猜你喜欢
    • 2014-10-20
    • 2017-09-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-05-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多