flutter_native_splash使用说明

Flutter插件:flutter_native_splash

配置

#Android12以上没有效果:会出现icon启动图;Android12以下才展示设置的launch背景图
flutter_native_splash:
  background_image: "assets/img/launch.png"
  fullscreen: true
  android: true
  ios: true
  
  android_12:
# The image parameter sets the splash screen icon image.  If this parameter is not specified,
# the app's launcher icon will be used instead.
# Please note that the splash screen will be clipped to a circle on the center of the screen.
# App icon with an icon background: This should be 960×960 pixels, and fit within a circle
# 640 pixels in diameter.
# App icon without an icon background: This should be 1152×1152 pixels, and fit within a circle
# 768 pixels in diameter.
    image: "assets/img/icon/app_punch.png"
# Splash screen background color.
    color: "#F0F4FF"
# The branding property allows you to specify an image used as branding in the splash screen.
    branding: "assets/img/inc.png"

命令:

生成:flutter pub run flutter_native_splash:create
移除:flutter pub run flutter_native_splash:remove

在Android12以上,该插件不生效,只会显示Android的启动动画画面,没办法显示自己设置的背景图启动页。
具体原因看:官网说明

从 Android 12 开始,在所有应用的冷启动和温启动期间,系统一律会应用 Android 系统的默认启动画面。默认情况下,此系统默认启动画面由应用的启动器图标元素和主题的 windowBackground(如果是单色)构成。

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值