Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change of homeAsUpIndicator icon in ActionbarSherlock does not effect in ICS?

I try to change the homeAsUpIndicator icon in the ActionBar. I use ActionBarSherlock to be compatible with older Android Versions. I set a specific theme to my Activity when the App runs on a device with Older verions of ICS and ICS it shows different colors.

This is the style i am using

<style name="Theme.PM" parent="@style/Theme.Sherlock.Light">

    <item name="android:homeAsUpIndicator">@drawable/back_sign</item> 
    <item name="homeAsUpIndicator">@drawable/back_sign</item>

</style>

like this below image's For ICS see that home as up indicator look like black color.

enter image description here

For Older versions of ICS see that home as up indicator look like white color.

enter image description here

i am using same image for both versions, but it's looking different on ICS. how to solve this problem..

like image 729
RajaReddy PolamReddy Avatar asked Mar 27 '13 05:03

RajaReddy PolamReddy


1 Answers

<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android">

    <style name="CustomStyleUpAsHome" parent="Theme.Sherlock.Light">
        <item name="android:actionBarStyle">@style/CustomActionBarUpAsHome</item>
        <item name="android:homeAsUpIndicator">@drawable/arrow_home</item>
        <item name="homeAsUpIndicator">@drawable/arrow_home</item>
    </style>

    <style name="CustomActionBarUpAsHome" parent="CustomActionBar">
        <item name="android:displayOptions">homeAsUp|useLogo|showHome</item>
        <item name="displayOptions">homeAsUp|useLogo|showHome</item>
    </style>

</resources>

<activity
    android:name=".activity.Activity"
    android:screenOrientation="portrait"
    android:theme="@style/CustomStyleUpAsHome">
</activity>

This code works great. Try to do something like that. May be it will help you.

Good luck!

like image 51
Ilya Demidov Avatar answered Sep 20 '22 17:09

Ilya Demidov