Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Customize Actionbar's back button

Tags:

android

enter image description hereenter image description here

<style name="MyActionBar.ActionBarStyle" parent="@android:style/Widget.Holo.Light.ActionBar">
    <item name="android:background">@drawable/button_style</item>
    <item name="android:titleTextStyle">@style/MyTheme.ActionBar.TitleTextStyle</item>
</style> 

How can i customize the actibar's navigate up button. Actualy i want that it's colors changes when i click it. For example Whatsapp, when i click back button the button's background color happens blue. How can i do it?

like image 838
Ahmet Avatar asked Nov 19 '14 20:11

Ahmet


1 Answers

You have to override the android:homeAsUpIndicator for your custom theme for your project.

<!-- Base application theme. -->
    <style name="AppTheme" parent="android:Theme.Holo.Light">
          <item name="android:homeAsUpIndicator">@drawable/ic_action_up_caret</item>
    </style>

Then set your custom there as the app theme in your manifest file (if you have not already):

<application
        android:name="com.example.app"
        android:theme="@style/AppTheme" >
like image 96
Andre Perkins Avatar answered Sep 27 '22 21:09

Andre Perkins