java - Set actionbar backgroung when using toolbar -
i have been learning android programing last weeks , have question. how can configure background color of action bar along status bar color when using theme.appcompat.light.noactionbar theme , setting toolbar in activity? in xml , not programmatically.
i following error when use
theme.appcompat.light.darkactionbar
as parent of custom style.
this activity has action bar supplied window decor. not request window.feature_support_action_bar , set windowactionbar false in theme use toolbar instead.
this works me:
<resources> <!-- base application theme. --> <style name="custommaterialtheme" parent="theme.appcompat.light.noactionbar"> <!-- customize theme here. --> <item name="colorprimary">@color/colorprimary</item> <item name="colorprimarydark">@color/colorprimarydark</item> <item name="actionmodebackground">@color/colorprimary</item> <item name="windowactionmodeoverlay">true</item> </style>
try make custom theme or add current theme this:
<style name="custommaterialtheme.base" parent="theme.appcompat.light.darkactionbar"> <item name="windownotitle">true</item> <item name="windowactionbar">false</item> <item name="colorprimary">@color/colorprimary</item> <item name="colorprimarydark">@color/colorprimarydark</item> <item name="android:textcolorprimary">@color/textcolorprimary</item> <item name="android:windowbackground">@color/windowbackground</item> </style>
hope helps.thanks refer here found beautiful tutorial http://coderzpassion.com/android-working-with-material-design/
Comments
Post a Comment