【问题标题】:Native splash screen image not working on flutter (Android)本机启动画面图像不适用于颤振(Android)
【发布时间】:2021-04-03 09:10:07
【问题描述】:

所以我试图在我的颤振应用程序中显示自定义启动画面图像。但由于某种原因,背景颜色和自定义图像也没有显示

我正在编辑 app/src/main/res/drawable 的路径

launch_background.xml

<?xml version="1.0" encoding="utf-8"?>
<!-- Modify this file to customize your launch splash screen -->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:drawable="@android:color/white" />

    <!-- You can insert your own image assets here -->
     <item>
        <bitmap
            android:gravity="center"
            android:src="@drawable/splash" />
    </item>
</layer-list>

无论我尝试多少次它都不会改变,我是一个新手,任何指导都会非常有帮助

【问题讨论】:

标签: flutter


【解决方案1】:

你应该试试这个

<item
        android:height="200dp"
        android:drawable="@drawable/splash"
        android:gravity="center" />

这对我有用。

【讨论】:

  • 位图你应该使用 .xml 文件
【解决方案2】:

..\android\app\src\main\res\drawable-v21\launch_background.xml 文件中用 android:drawable="@mipmap/launcher_icon" 替换 android:src="@mipmap/ic_launcher" /&gt; 对我有用

【讨论】:

    猜你喜欢
    • 2018-09-15
    • 2015-08-22
    • 2019-03-26
    • 1970-01-01
    • 1970-01-01
    • 2020-02-09
    • 1970-01-01
    • 2021-02-24
    相关资源
    最近更新 更多