[英]Problem with the splashscreen after resume ( Flutter - Android )
當我想在 android 上恢復我的應用程序時,我的 flutter 應用程序有問題。 所以我測試了生成的示例 flutter 應用程序,但問題也存在於那里。 我只修改了 launch_background.xml 文件以將背景顏色更改為黑色並將啟動器圖標置於初始屏幕上。
問題是,當我暫停應用程序后恢復應用程序時,啟動畫面會在短時間內可見。 下面的 gif 顯示了問題。
有沒有人知道這個解決方案,或者我必須處理那個?
提前致謝
--EDIT--Android 中對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:windowBackground">@drawable/launch_background</item>
</style>
</resources>
嘗試使用flutter_native_splash 。 我在我的所有項目中都使用它,它完美無缺。 他們的醫生說:
自動生成用於在 Android 和 iOS 中添加啟動畫面的本機代碼。 使用特定平台、背景顏色和初始圖像進行自定義。
進行所有更改后,請確保使用以下行運行包:
flutter pub pub run flutter_native_splash:create
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.