material design - Change color of DrawerToggle in toolbar on Android -
can pinpoint why drawer toggle (the little hamburger icon animates open navigation drawer) refuses switch color on me? it's causing me lot of downtime , can't seem figure out why.
here's theme - drawer toggle takes on color of disabled_default_text.
<style name="theme.myapp.noactionbar" parent="theme.myapp.noactionbar"> <item name="actionbarstyle">@style/widget.myapp.actionbar</item> <item name="coloraccent">@color/cs7</item> <item name="colorcontrolnormal">@color/disabled_default_text</item> </style>
and here's toolbar layout:
<?xml version="1.0" encoding="utf-8"?> <android.support.v7.widget.toolbar xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="?attr/actionbarsize" android:background="@drawable/ab_solid" android:minheight="?attr/actionbarsize" app:theme="@style/mytoolbartheme" app:elevation="@dimen/toolbar_elevation"/>
mytoolbartheme - overwrite colorcontrolnormal color white.
<style name="mytoolbartheme" parent="@style/widget.appcompat.actionbar.solid"> <item name="background">@drawable/ab_solid</item> <item name="titletextstyle">@style/mytitlestyle</item> <item name="colorcontrolnormal">@color/white</item> </style>
what's odd adding colorcontrolnormal changes color of overflow menu disabled_default_text color white, drawer toggle doesn't changed. can figure out i'm doing wrong?
you can add drawerarrowstyle
to theme as
<style name="apptheme" parent="theme.appcompat.light.darkactionbar"> <item name="drawerarrowstyle">@style/mydrawerarrowtoggle</item> </style>
and can customize mydrawerarrowtoggle
<style name="mydrawerarrowtoggle" parent="widget.appcompat.drawerarrowtoggle"> <item name="color">@color/white</item> </style>
Comments
Post a Comment