Flutter 启动页白屏设置/启动画面设置

  • 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>

在这里插入图片描述
在这里插入图片描述

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值