- flutter 中文网 启动页相关介绍 https://flutter.cn/docs/development/add-to-app/android/add-splash-screen
- 其他相关参考有ios启动页设置 http://www.flutterj.com/?post=134
新建flutter项目 刚启动是有段时间的白屏 ,这个是系统开机的白屏,可以更换成自己的启动画面,设置如下:
launch_backgroud.xml里修改成自己的图片名称,src表示图片的名称不带扩展名,mipmap表示对应各种分辨率下的图片
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/white" />
<!-- You can insert your own image assets here -->
<!-- <item>
<bitmap
android:gravity="fill"
android:src="@mipmap/launch_image" />
</item> -->
<item>
<bitmap
android:gravity="center"
android:src="@mipmap/launcher" />
</item>
</layer-list>
设置全屏图片
styles.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:windowFullscreen">false</item>
<item name="android:windowNoTitle">true</item>
<item name="android:windowBackground">@mipmap/launcher</item>
</style>
</resources>