Skip to content Skip to sidebar Skip to footer

Actionbarsherlock: Changing Homeasupindicator Doesn't Work

I'm want to change the up icon with applying the following style to my activity, but it doesn't work and but I still get the default black '<' icon. Can anyone find out what is

Solution 1:

If I remember correctly, I worked around this issue by moving you should move the android:homeAsUpIndicator and homeAsUpIndicator elements into the main theme declaration. In other words, try:

<stylename="AppTheme.ActionBar"parent="@style/Theme.Sherlock.Light"><itemname="actionBarStyle">@style/actionBarStyle</item><itemname="android:actionBarStyle">@style/actionBarStyle</item><itemname="android:homeAsUpIndicator">@drawable/up_indicator</item><itemname="homeAsUpIndicator">@drawable/up_indicator</item></style><stylename="actionBarStyle"parent="@style/Widget.Sherlock.Light.ActionBar.Solid"><itemname="android:background">@drawable/header_bar</item><itemname="background">@drawable/header_bar</item><itemname="android:displayOptions">homeAsUp|showHome</item><itemname="displayOptions">homeAsUp|showHome</item></style>

Not sure whether I also had to move up the displayOptions, but you may want to give that a go too in case above doesn't work right away.

By the way, I find naming a style AppTheme.ActionBar and then inheriting from Theme.Sherlock.Light rather confusing. If it were an ActionBar specific style, I would've expected something like Widget.Holo.Light.ActionBar (or any of the other widget styles) as the parent. If it's your main theme, I'd name it accordingly. Up to you of course.


Edit: Updated answer after Jake's comment.

Post a Comment for "Actionbarsherlock: Changing Homeasupindicator Doesn't Work"