【问题标题】:Single image launch screen implementation for cordova hybrid app科尔多瓦混合应用程序的单图像启动屏幕实现
【发布时间】:2017-09-10 15:31:16
【问题描述】:

我已经浏览了splash doc https://github.com/apache/cordova-plugin-splashscreen#single-image-launch-screen 此处仅使用 2732x2732px 的单个图像将在所有设备上显示飞溅。

在 Android 平台部分,我在 config.xml 中指定了以下行

<splash src="www/images/test.png" />

我还添加了对启动画面的偏好

<preference name="SplashScreen" value="screen" />
<preference name="AutoHideSplashScreen" value="true" />
<preference name="SplashMaintainAspectRatio" value="true" />

但这不起作用。当我尝试打开应用程序时,应用程序崩溃了。当我添加所有具有密度的飞溅时,它会按照https://stackoverflow.com/a/36045485/4677062 中的说明工作。 而文档告诉这可以使用单个图像来完成,只需将一个飞溅添加到配置中,而不是针对上述链接中指定的所有密度图像。

【问题讨论】:

    标签: android cordova splash-screen


    【解决方案1】:

    单张图片启动说明适用于 iOS 而不是 Android。

    对于 Android,您应该使用例如:

        <splash qualifier="land-hdpi" src="res/android/splash/landscape-hdpi.png" />
        <splash qualifier="land-ldpi" src="res/android/splash/landscape-ldpi.png" />
        <splash qualifier="land-mdpi" src="res/android/splash/landscape-mdpi.png" />
        <splash qualifier="land-xhdpi" src="res/android/splash/landscape-xhdpi.png" />
        <splash qualifier="port-hdpi" src="res/android/splash/portrait-hdpi.png" />
        <splash qualifier="port-ldpi" src="res/android/splash/portrait-ldpi.png" />
        <splash qualifier="port-mdpi" src="res/android/splash/portrait-mdpi.png" />
        <splash qualifier="port-xhdpi" src="res/android/splash/portrait-xhdpi.png" />
    

    注意:res/android/splash/是我的具体路径,我的自定义构建系统将文件从这个文件夹复制到www/images/

    【讨论】:

    • 不是density而不是qualifier吗?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-12-18
    • 2015-04-26
    • 2019-12-16
    • 2017-07-31
    • 1970-01-01
    相关资源
    最近更新 更多