<style name="AppTheme" parent="android:Theme.Material.Light">
<item name="colorPrimary">@color/colorPrimary</item>
<item name="android:statusBarColor">@color/colorPrimaryDark</item>
<item name="android:textColorPrimary">@color/colorAccent</item>
<item name="android:windowBackground">@color/colorWindowBackground</item>
<item name="colorAccent">@color/colorAccent</item>
</style>
</resources>
上面是我在项目里引入Material主题的代码,我想自己设置一下ActionBar的背景色,但发现这属性没起作用?有知道原因的吗?谢谢!
You posted the above, I tried it and it works. . The following is the official document
ActionBar is defined by the android:colorPrimary attribute, please check again
Also, the color of the status bar is best to use the android:colorPrimaryDark attribute