In my app I use action bar and navigation drawer. There's a button in the action bar for opening and closing navigation drawer. I'd like to change its color to red. How do I do that?
Asked
Active
Viewed 5,446 times
2
-
3change the main color https://developer.android.com/training/material/theme.html#ColorPalette – Hugo Gresse Apr 23 '15 at 13:12
-
You can change the drawable image direcly http://stackoverflow.com/questions/18816418/how-do-i-change-the-color-of-actionbars-up-arrow – A B Apr 23 '15 at 13:13
-
Thanks, Hugo Gresse. I can't believe it was this simple :) – Egis Apr 23 '15 at 13:17
2 Answers
3
solved on this Appcombat v7 Toolbar with drawer changing colors,
do the following in your theme 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="color">@color/your_red_color</item>
</style>

Community
- 1
- 1

elliotching
- 972
- 1
- 10
- 33
1
You have to set your app main color following Material Theme : (official documentation)
res/values/colors.xml
<resources>
<!-- inherit from the material theme -->
<style name="AppTheme" parent="android:Theme.Material">
<!-- Main theme colors -->
<!-- your app branding color for the app bar -->
<item name="android:colorPrimary">@color/primary</item>
<!-- darker variant for the status bar and contextual app bars -->
<item name="android:colorPrimaryDark">@color/primary_dark</item>
<!-- theme UI controls like checkboxes and text fields -->
<item name="android:colorAccent">@color/accent</item>
</style>
</resources>
Another way is to generate the icon on your own : Toolbar Navigation Hamburger Icon missing

Community
- 1
- 1

Hugo Gresse
- 17,195
- 9
- 77
- 119