Android L taskbar background color

As stated here , I should be able to change the color of my ActionBar if I define a foreground color in my style.

<style name="AppTheme" parent="android:Theme.Material"> <item name="android:colorPrimary">#ff0000</item> </style> 

However, the color is still gray by default. Did I miss something?

+6
source share
3 answers

There is a values ​​folder-21 ... I made changes to the values ​​folder and, of course, it was not used.

+3
source

As the docs say, you should use @android:style/Theme.Material as the parent theme, not android:Theme.Material .

Then you can use <item name="android:colorPrimary">#ff0000</item> , just like you.

+5
source

You can simply use this as the parent theme in the res / values-v21 folder :

 <style name="Theme.Base" parent="android:Theme.Material" /> 

Then refer to this stylesheet as follows:

 <style name="Theme.Sample" parent="Theme.Base" /> 
0
source

Source: https://habr.com/ru/post/971458/


All Articles