android - Flutter闪屏android多张图片
问题描述
嘿,我有使用颤振构建的应用程序,我用这段代码在 android 上实现了启动画面,并且它完全可以工作。
样式.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:windowBackground">@drawable/launch_background</item>
<item name="android:windowFullscreen">true</item>
</style>
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
</style>
</resources>
和launch_background.xml
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@color/company" />
<item>
<bitmap
android:gravity="fill_horizontal|fill_vertical"
android:src="@drawable/screen" />
</item>
</layer-list>
但是如果我再添加一张图片,它就可以工作,但是,在 splascreen 之后,应用程序会在颤振控制台中强制关闭而不会出现错误通知。所以代码看起来像这样 launch_background.xml
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@color/company" />
<item>
<bitmap
android:gravity="fill_horizontal|fill_vertical"
android:src="@drawable/screen" />
</item>
<item>
<bitmap
android:gravity="center"
android:src="@drawable/company_icon" />
</item>
如何修复或使其工作?谢谢
解决方案
推荐阅读
- amazon-web-services - AWS S3 操作策略 CLI 与控制台将对象粘贴到一个存储桶中
- javascript - 从这个 google 地方 API 地址结果中提取地址片段的最佳方法是什么?
- python-3.x - 如何使用用户输入将多个项目附加到列表中而不覆盖列表中已有的项目?
- javascript - Google Chrome Windows/iOS 桌面通知
- php - Laravel 排序错误
- python - 您如何使用面向对象编程在 Python 中对龟兔赛跑进行编程,更具体地说,我们如何让它们实际移动?
- json - 对 jq 中的值运行终端操作
- javascript - 如何在javascript中制作一个可以直接读取任何文件并用现有文本替换自身的函数?
- android-source - 使用 ftruncate(fd_out, GetSize()) 在 WSL 中编译 AOSP 失败:参数无效
- php - 您将如何向模态显示数据?