Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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

like image 397
Rasmus Avatar asked Sep 15 '13 19:09

Rasmus


People also ask

How do I change the color of my taskbar icons on Android?

Also, if you want to change the toolbar text color: Spannable spannableString = new SpannableString(t); spannableString. setSpan(new ForegroundColorSpan(Color. rgb(50, 50, 50)), 0, t.

What is Toolbar Android?

In Android applications, Toolbar is a kind of ViewGroup that can be placed in the XML layouts of an activity. It was introduced by the Google Android team during the release of Android Lollipop(API 21). The Toolbar is basically the advanced successor of the ActionBar.

What is colorControlNormal?

boxme/Android Color Control Cheat Sheet For instance, "android:colorControlNormal" becomes "colorControlNormal". These attributes will be propagated to their corresponding attributes within the android namespace. for devices running Lollipop. Any exceptions to this will be noted by including the "android:" prefix.


2 Answers

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>
like image 120
mmBs Avatar answered Sep 20 '22 14:09

mmBs


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.

like image 40
Oguz Ozcan Avatar answered Sep 18 '22 14:09

Oguz Ozcan