I have been able to customize the action bar's background, logo image and text color using suggestions from these:
Android: How to change the ActionBar "Home" Icon to be something other than the app icon?
ActionBar text color
ActionBar background image
The last piece I want to customize is the back button image. It's grey by default and I would like it to be white. Either changing the color, specifying a drawable or simply making it transparent (and adding the chevron to my customized logo image) would work. How do I go about that?
This example demonstrate about how to create a custom action bar in Android. Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project. Step 2 − Add the following code to res/layout/activity_main. xml.
ActionBar actionBar = getActionBar(); actionBar. setHomeButtonEnabled(true);
The "up" affordance indicator is provided by a drawable specified in the homeAsUpIndicator
attribute of the theme. To override it with your own custom version it would be something like this:
<style name="Theme.MyFancyTheme" parent="android:Theme.Holo"> <item name="android:homeAsUpIndicator">@drawable/my_fancy_up_indicator</item> </style>
If you are supporting pre-3.0 with your application be sure you put this version of the custom theme in values-v11
or similar.
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