2

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?

enter image description here

Egis
  • 4,582
  • 4
  • 37
  • 56

2 Answers2

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
  • 833
  • 1
  • 10
  • 27
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
  • 16,027
  • 8
  • 76
  • 110