How do I change the color of actionbar's up arrow?

17,878

Solution 1

The answer is provided by Jake Wharton in How to customize the back button on ActionBar

<style name="Theme.MyTheme" parent="android:Theme.Holo">
    <item name="android:homeAsUpIndicator">@drawable/my_up_indicator</item>
</style>

Solution 2

If you are using Toolbar, you can change the color by just changing the theme. You only have to change the style of the toolbar

app:theme="@style/ThemeOverlay.AppCompat.Light"

app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"

If you are using a dark.actionBar your back button is going to be white else if you are using light actionbar theme it is going to be black.

Update: If you want to modify the color as you wish (other then black or white) you can define a new style, parent one of the above themes and set colorControlNormal or android:textColorSecondary values to your desired color.

Share:
17,878

Related videos on Youtube

Rasmus
Author by

Rasmus

Updated on September 15, 2022

Comments

  • Rasmus
    Rasmus over 1 year

    How do I change the actionbar's up arrow. I am using the action bar in android not ABS or actionbarcompat. Is there a way to change the color /image of the action bar's up arrow ?

    enter image description here

  • DKIT
    DKIT almost 9 years
    You assume he wants to change every action bar in the whole app.
  • Oguz Ozcan
    Oguz Ozcan almost 9 years
    No. By using toolbar implementation you can customise action bar for every activity. Just by setting setSupportActionBar(toolbar). Or you can define multiple action bar styles and use it according to your need.
  • Oguz Ozcan
    Oguz Ozcan almost 9 years
    If you have any question about this subject i can give additional information. Please remove your down vote.
  • Shirish Herwade
    Shirish Herwade over 8 years
    was struggling for 3 hours, tried lot of things, but not working on older versions. And going to Dark from Light was the key, thanks so so much
  • Oguz Ozcan
    Oguz Ozcan over 8 years
    You welcome..By the way, I updated the answer. You can try out that too.