I am using a toolbar in place of actionbar and i am also using a navigation drawer.My toolbar colour is black and i want my navigation drawer indicator colour to be white.So how to change the colour of the navigation drawer indicator or put a custom navigation indicator in v7.Can any one please help me?
Asked
Active
Viewed 5.4k times
54
-
Possible duplicate of [Color of animated ActionBarDrawerToggle in ActionBar](http://stackoverflow.com/questions/27250915/color-of-animated-actionbardrawertoggle-in-actionbar) – Sanf0rd Oct 21 '16 at 20:56
-
1I have answered how to do it programmatically on another question(http://stackoverflow.com/questions/27250915/color-of-animated-actionbardrawertoggle-in-actionbar/40164200#40164200). Please mark this question as duplicate. – Sanf0rd Oct 22 '16 at 02:01
5 Answers
141
Try creating this style in your styles.xml
.
<style name="DrawerArrowStyle" parent="Widget.AppCompat.DrawerArrowToggle">
<item name="color">@android:color/white</item>
</style>
And, then add it to you AppTheme style like the following.
<item name="drawerArrowStyle">@style/DrawerArrowStyle</item>

Morgan Koh
- 2,297
- 24
- 24

Dom
- 8,222
- 2
- 15
- 19
-
5It only changes hamburger icon color. Back arrow color remains unchanged. – VishalKale Jul 21 '16 at 07:55
-
1
-
@RishabhSrivastava Add `app:popupTheme` and `app:theme` to toolbar. And use ` `. – VishalKale Nov 30 '17 at 09:14
23
In your AppTheme add this style.
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<item name="drawerArrowStyle">@style/DrawerArrowStyle</item>
</style>
<style name="DrawerArrowStyle" parent="Widget.AppCompat.DrawerArrowToggle">
<item name="spinBars">true</item>
<item name="color">@android:color/white</item>
</style>

Lalit kumar
- 2,377
- 1
- 22
- 17
19
Put this code in your activity
toggle.getDrawerArrowDrawable().setColor(getResources().getColor(R.color.grey));

LopezDevelop
- 291
- 7
- 13
11
The following worked for me.
<style name="ToolBarStyle" parent="Theme.AppCompat.Light.NoActionBar">
<item name="colorControlNormal">@android:color/white</item>
</style>

swiftBoy
- 35,607
- 26
- 136
- 135

Jasmine John
- 873
- 8
- 12
-
its is the best and shortest method to change color of navigation indicator , thanks – Najaf Ali Jan 12 '18 at 12:23
2
1: Go to directory res
-> themes.xml
2: Inside:
<style name="Theme.YourAppName" parent="Theme.MaterialComponents.Light.NoActionBar">
add this line:
<item name="colorControlNormal">@android:color/white</item>
you can add this to themes.xml (night)
or you may change it according to your preferred style.

F.Mysir
- 2,838
- 28
- 39