Android项目的状态栏无法更改颜色
这是我的Android项目的状态栏无法更改颜色,android,kotlin,statusbar,Android,Kotlin,Statusbar,这是我的themes.xml <resources xmlns:tools="http://schemas.android.com/tools"> <!-- Base application theme. --> <style name="Theme.ColorMyViews" parent="Theme.AppCompat.DayNight.DarkActionBar">
themes.xml
<resources xmlns:tools="http://schemas.android.com/tools">
<!-- Base application theme. -->
<style name="Theme.ColorMyViews" parent="Theme.AppCompat.DayNight.DarkActionBar">
<!-- Primary brand color. -->
<item name="colorPrimary">#BE19FF</item>
<item name="colorPrimaryVariant">#a100e0</item>
<item name="colorOnPrimary">@color/white</item>
<!-- Secondary brand color. -->
<item name="colorSecondary">@color/teal_200</item>
<item name="colorSecondaryVariant">@color/teal_700</item>
<item name="colorOnSecondary">@color/black</item>
<!-- Customize your theme here. -->
</style>
</resources>
#BE19FF
#a100e0
@颜色/白色
@颜色/青色200
@颜色/青绿色700
@颜色/黑色
无论我尝试什么,状态栏的颜色都不会改变!
请帮忙 状态栏颜色基于当前主题的
colorPrimaryDark
值
<item name="colorPrimaryDark">????</item>
????
状态栏颜色基于当前主题的colorPrimaryDark
值
<item name="colorPrimaryDark">????</item>
????
哦!我知道怎么做了。将此行添加到主题的底部:
?attr/colorPrimaryVariant
那是因为我使用的是最新的Android Studio版本。哦!我知道怎么做了。将此行添加到主题的底部:
?attr/colorPrimaryVariant
那是因为我使用的是最新的Android Studio版本。等等,你是说colorPrimaryVariant吗?这是我仅有的东西。不,把那个标签加在你的主题上。你是说颜色的原色变体吗?这是我唯一拥有的。不,把那个标签添加到你的主题中