flutter_native_splash包在iOS和Android中创建了屏幕中央的图像。

huangapple go评论98阅读模式
英文:

flutter_native_splash package created image in center of screen in both ios and android

问题

我使用了 flutter_native_splash 包来创建启动屏幕,但在 iOSAndroid 上都是屏幕中央显示图像。

我的 Pubspec.yaml 文件如下:

flutter_native_splash: ^2.2.19

flutter_native_splash:
  color: "#ffffff"
  image: assets/images/splash_screen.jpeg
  android: true
  ios: true
  fullscreen: true

我尝试了很多方法,但最好的方法是在本地处理 Android 和 iOS。

英文:

i used flutter_native_splash package for created splash screen
but image in center of screen in both IOS and Android
my Pubspec.yaml

  flutter_native_splash: ^2.2.19

  flutter_native_splash:
    color: "#ffffff"
    image: assets/images/splash_screen.jpeg
    android: true
    ios: true
    fullscreen: true

i tried many ways but the best was doing it native android and ios

答案1

得分: 1

Android中:

前往

1- android\app\src\main\res\drawable-v21

2- android\app\src\main\res\drawable

并将重力设置为填充(fill),而不是居中。

iOS中:

1- 使用Xcode打开iOS文件夹

2- 进入runner和launch screen

3- 将内容模式更改为"scale to fill",而不是居中。

英文:

i have solved it my add native configuration in ios and android

in android

go to

1- android\app\src\main\res\drawable-v21

2- android\app\src\main\res\drawable

and change gravity to fill not center

flutter_native_splash包在iOS和Android中创建了屏幕中央的图像。

in ios

1-open ios folder with xcode

2-go to runner and launch screen

3-change content mode to "scale to fill" not center

flutter_native_splash包在iOS和Android中创建了屏幕中央的图像。

huangapple
  • 本文由 发表于 2023年6月15日 16:39:48
  • 转载请务必保留本文链接:https://go.coder-hub.com/76480657.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定