英文:
flutter_native_splash package created image in center of screen in both ios and android
问题
我使用了 flutter_native_splash 包来创建启动屏幕,但在 iOS 和 Android 上都是屏幕中央显示图像。
我的 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
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
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论