Browse Source

增加启动图

maqiang 11 months ago
parent
commit
e8fe2f8801

+ 8 - 0
android/app/src/main/AndroidManifest.xml

@@ -59,6 +59,14 @@
59 59
             <meta-data
60 60
                 android:name="io.flutter.embedding.android.NormalTheme"
61 61
                 android:resource="@style/NormalTheme" />
62
+            <!-- Displays an Android View that continues showing the launch screen
63
+                 Drawable until Flutter paints its first frame, then this splash
64
+                 screen fades out. A splash screen is useful to avoid any visual
65
+                 gap between the end of Android's launch screen and the painting of
66
+                 Flutter's first frame. -->
67
+            <meta-data
68
+                android:name="io.flutter.embedding.android.SplashScreenDrawable"
69
+                android:resource="@drawable/launch_background" />
62 70
             <intent-filter>
63 71
                 <action android:name="android.intent.action.MAIN" />
64 72
                 <category android:name="android.intent.category.LAUNCHER" />

+ 0 - 12
android/app/src/main/res/drawable-v21/launch_background.xml

@@ -1,12 +0,0 @@
1
-<?xml version="1.0" encoding="utf-8"?>
2
-<!-- Modify this file to customize your launch splash screen -->
3
-<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
4
-    <item android:drawable="?android:colorBackground" />
5
-
6
-    <!-- You can insert your own image assets here -->
7
-    <!-- <item>
8
-        <bitmap
9
-            android:gravity="center"
10
-            android:src="@mipmap/launch_image" />
11
-    </item> -->
12
-</layer-list>

+ 5 - 9
android/app/src/main/res/drawable/launch_background.xml

@@ -1,12 +1,8 @@
1
-<?xml version="1.0" encoding="utf-8"?>
2
-<!-- Modify this file to customize your launch splash screen -->
1
+<?xml version="1.0" encoding="utf-8"?><!-- Modify this file to customize your launch splash screen -->
3 2
 <layer-list xmlns:android="http://schemas.android.com/apk/res/android">
4
-    <item android:drawable="@android:color/white" />
5
-
6
-    <!-- You can insert your own image assets here -->
7
-    <!-- <item>
3
+    <item>
8 4
         <bitmap
9
-            android:gravity="center"
10
-            android:src="@mipmap/launch_image" />
11
-    </item> -->
5
+            android:gravity="fill"
6
+            android:src="@drawable/launch_image" />
7
+    </item>
12 8
 </layer-list>

BIN
android/app/src/main/res/drawable/launch_image.webp