【发布时间】:2020-05-23 16:35:24
【问题描述】:
launch_background.xml
<?xml version="1.0" encoding="utf-8"?>
<!-- Modify this file to customize your launch splash screen -->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@color/orange" />
<!-- You can insert your own image assets here -->
<item>
<bitmap
android:gravity="center"
android:src="@drawable/splash_icon" />
</item> -->
</layer-list>
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>
<color name="orange">#FF9800</color>
</resources>
我动态更改应用程序中的原色值并为应用程序设置主题颜色。如何在此处发送原色值 --> <color name="orange">#FF9800</color>
还有IOS应该怎么做?
【问题讨论】:
-
这样做的目的是什么?您想在每次启动应用程序时在启动画面中看到不同的颜色吗?或者有没有一种方法可以让用户设置他选择的启动画面颜色?能详细解释一下吗?
-
我的应用中有不同的主题颜色。我想根据主题颜色改变闪屏背景颜色。
-
主题颜色什么时候改变,在哪个动作期间?
-
应用程序运行期间的任何时间。我将颜色值保存到共享首选项
-
您已经找到解决方案了吗?
标签: android ios flutter splash-screen