Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/100.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何使flatter中的闪屏背景透明(适用于Android和IOS)?_Android_Ios_Flutter - Fatal编程技术网

如何使flatter中的闪屏背景透明(适用于Android和IOS)?

如何使flatter中的闪屏背景透明(适用于Android和IOS)?,android,ios,flutter,Android,Ios,Flutter,我想使启动屏幕背景透明,这样当应用程序启动时,屏幕上只显示一个图标 到目前为止,我在针对Android的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.

我想使启动屏幕背景透明,这样当应用程序启动时,屏幕上只显示一个图标

到目前为止,我在针对Android的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/transparent" />
     <item>
        <bitmap
            android:src="@drawable/index"
            android:gravity="center"
            />
    </item>
</layer-list>

但我得到的是一个黑色背景,比如:

形象

我想要的是这样的东西:

如何正确处理这个问题?谢谢大家!


顺便说一句:IOS呢?

scaffold
中使用
Background
颜色,并将
Opacity
设置为黑色,如下所示:

Colors.black.withOpacity(0.5) // change this opacity as per your requirement

您希望通过透明度显示什么?电话背景?这不是它的工作原理。该应用程序有自己的窗口。黑色背景是应用程序的“背后”。@Paulw11嗨,我想要的是这样的:你绝对不能在iOS上这么做。