You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Flutter中如何移除启动时的原生Flutter图标?

解决Flutter原生启动页默认图标移除问题

要去掉Flutter应用加载时原生层的默认图标,只需调整启动页主题的背景配置,具体操作如下:

1. 新建启动背景Drawable文件

在android/app/src/main/res/drawable目录下创建splash_background.xml,内容如下:

<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
    <!-- 仅保留纯色背景,不包含图标元素 -->
    <item android:drawable="@color/splash_background" />
</layer-list>

2. 更新styles.xml的LaunchTheme

把原来直接设置颜色的android:windowBackground替换为指向上述Drawable:

<style name="LaunchTheme" parent="Theme.AppCompat.Light.NoActionBar">
    <item name="android:windowBackground">@drawable/splash_background</item>
</style>

3. 确认颜色配置

你的colors.xml中已有的splash_background配置可以继续使用:

<resources>
    <color name="splash_background">#FFC0CB</color>
</resources>

完成这些修改后,启动页就只会显示你设置的纯色背景,默认Flutter图标不会再出现。注意不要改动AndroidManifest.xml里application标签的android:icon,这个是应用的桌面图标,和启动页无关。

内容的提问来源于stack exchange,提问作者Malak

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.19 19:54:57