颤振启动画面

Flutter Spash Screen

android:src="@drawable/grouptop" /> 如何自定义启动画面图像的图像大小。我知道通过图像编辑设置它的像素大小。 但是有什么方法可以自定义尺寸(长度,宽度)?

在 drawable 文件夹中像这样制作启动器背景

<?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
        android:width="200dp"
        android:height="100dp"
        android:gravity="center"
        android:drawable="@drawable/splash">
    </item>
</layer-list>

使用这个style.xml

 <?xml version="1.0" encoding="utf-8"?>
    <resources>
        <style name="LaunchTheme" parent="@android:style/Theme.Black.NoTitleBar">
            <!-- Show a splash screen on the activity. Automatically removed when
                 Flutter draws its first frame -->
            <item name="android:windowBackground">@drawable/launch_background</item>
            <item name="android:windowDisablePreview">true</item>

        </style>
    </resources>

在清单文件中定义

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