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

Flutter修改启动屏后中间出现白色圆圈的去除方法

解决Flutter启动屏中间白色圆圈问题

你遇到的白色圆圈是Flutter Android端默认的启动图标(或系统默认启动屏图标),可通过以下步骤彻底移除:

1. 检查并修改启动主题配置(styles.xml)

打开android/app/src/main/res/values/styles.xml,找到名为LaunchTheme的主题,确保配置如下(移除所有引用默认图标的项):

<style name="LaunchTheme" parent="@android:style/Theme.Black.NoTitleBar">
    <item name="android:windowBackground">@drawable/launch_background</item>
    <!-- 禁用默认内容层图标 -->
    <item name="android:windowContentOverlay">@null</item>
    <item name="android:windowDrawsSystemBarBackgrounds">true</item>
</style>

若你的应用需要适配Android 12及以上,还需打开android/app/src/main/res/values-v31/styles.xml,修改对应主题:

<style name="LaunchTheme" parent="@android:style/Theme.Material.Light.NoActionBar">
    <item name="android:windowBackground">@drawable/launch_background</item>
    <!-- 禁用Android 12+默认的启动屏动画图标 -->
    <item name="android:windowSplashScreenAnimatedIcon">@null</item>
    <item name="android:windowSplashScreenBackground">@color/background_color</item>
</style>

2. 确认AndroidManifest.xml的主题引用

打开android/app/src/main/AndroidManifest.xml,检查MainActivity的android:theme属性是否指向修改后的LaunchTheme:

<activity
    android:name=".MainActivity"
    android:exported="true"
    android:launchMode="singleTop"
    android:theme="@style/LaunchTheme"
    android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
    android:hardwareAccelerated="true"
    android:windowSoftInputMode="adjustResize">

3. 清理缓存并重建项目

执行以下命令清理Flutter缓存,避免旧资源残留:

flutter clean
flutter run

完成以上步骤后,启动屏的白色圆圈会消失,只显示你自定义的背景和图片。

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.06.26 05:22:41