Flutter splash screen, a white circle for andorid, is there a way to change that to black or any other color?

huangapple go评论53阅读模式
英文:

Flutter splash screen, a white circle for andorid, is there a way to change that to black or any other color?

问题

以下是翻译的内容:

Android 屏幕,正如您所看到的,位于上方的白色圆圈,有办法更改它的颜色吗

iPhone 屏幕,对于 iPhone 部分,它运行得很好,有点符合我的要求

尝试过调整背景图像以及图像大小,但任何帮助都将不胜感激。想要去掉 Android 屏幕中的那个白色圆圈。

英文:

Android Screen, As you can see that white circle behind up-help, is there a way to change the color of that

Iphone Screen, it is working great for the iphone side, kinda what i want

Tried messing with the background image as well as the image size but any help would be great. Want to get rid of that white circle in the android screen.

答案1

得分: 1

我维护一个名为 flutter_native_splash 的包,它允许您轻松地修改 Android 12 图标的背景颜色,以及许多其他参数。 在该包中,您需要更改以下参数:

flutter_native_splash:
  android_12:
    # 应用程序图标的背景颜色。
    icon_background_color: "#111111"
英文:

I maintain a package flutter_native_splash that allows you to easily modify the Android 12 icon background color, among many other parameters. In that package, you would change the following parameter:

flutter_native_splash:
  android_12:
    # App icon background color.
    icon_background_color: "#111111"

答案2

得分: 0

你需要更改 android/app/src/main/res/drawable 目录下的 launch_background.xml 文件。

<?xml version="1.0" encoding="utf-8"?>
<!-- 修改此文件以自定义启动闪屏屏幕 -->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:drawable="@android:color/white" /> <!-- 这里 -->
    
    <!-- 你可以在这里插入自己的图像资源 -->
    <!-- 
    <item>
        <bitmap
            android:gravity="center"
            android:src="@mipmap/launch_image" />
    </item>
    -->
</layer-list>
英文:

You have to change the launch_background.xml on android/app/src/main/res/drawable

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

    &lt;!-- You can insert your own image assets here --&gt;
    &lt;!-- &lt;item&gt;
        &lt;bitmap
            android:gravity=&quot;center&quot;
            android:src=&quot;@mipmap/launch_image&quot; /&gt;
    &lt;/item&gt; --&gt;
&lt;/layer-list&gt;

huangapple
  • 本文由 发表于 2023年2月23日 23:43:18
  • 转载请务必保留本文链接:https://go.coder-hub.com/75547112.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定