Android Action Bar Background color -
i have looked @ android documentation , other examples still cant action bar style work. have set theme "apptheme" in android manifest background color won't change.
here styles.xml:
<!-- base application theme. --> <style name="apptheme" parent="theme.appcompat.light.darkactionbar"> <!-- customize theme here. --> <item name="android:actionbarstyle">@style/actionbartheme</item> </style> <style name="actionbartheme" parent="widget.appcompat.light.actionbar.solid.inverse"> <item name="android:background">#9d0d0d</item> <item name="background">#9d0d0d</item> </style> i found out need define style twice, once using item name "android:background" , using item name "background". latter support library compatibility. error when run app:
error:(11, 41) color types not allowed (at 'background' value '#9d0d0d'). why android not allow color item name "background" allows color "android:background"? there else wrong?
try code:
<style name="apptheme" parent="theme.appcompat.light.darkactionbar"> <!-- customize theme here. --> <item name="colorprimarydark">@color/primarydarkcoloractionbar</item> <item name="colorprimary">@color/primarycoloractionbar</item> </style> also, actionbaractivity deprecated in latest appcompat update i.e. 22.1.1 . better use appcompatactivityinstead (if not using it).
Comments
Post a Comment