How do I change the color of actionbar's up arrow?
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.
Related videos on Youtube
Rasmus
Updated on September 15, 2022Comments
-
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 ?
-
DKIT almost 9 yearsYou assume he wants to change every action bar in the whole app.
-
Oguz Ozcan almost 9 yearsNo. 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 almost 9 yearsIf you have any question about this subject i can give additional information. Please remove your down vote.
-
Shirish Herwade over 8 yearswas 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 over 8 yearsYou welcome..By the way, I updated the answer. You can try out that too.