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 ?
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.
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.
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.
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>
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With