如何去掉Flutter启动画面中的徽标白色背景?

问题描述 投票:0回答:1

我正在尝试摆脱出现在我的徽标周围的白色背景。

我可以从这里更改背景 android/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="@color/back_color"/>

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

但即使资源中的图像没有白色背景,图像也显示白色背景。我怎样才能去掉这个白色背景?

注意:我在 Android Studio 中使用 Flutter

flutter splash-screen
1个回答
0
投票

像这样改变它:

<?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/logo" />
        
    </item>
    
    
    
    
    
</layer-list>
© www.soinside.com 2019 - 2024. All rights reserved.