Styling ActionBarSherlock – change icon of overflow menu button

I Needed to change the overflow menu button according to my application theme. so I spent few hours on how to style these things in Sherlock action bar.
So I am sharing my knowledge as it might be useful to someone in somewhere.

Just few steps

1)make your application theme something like shown below

<?xml version="1.0" encoding="utf-8"?>
<resources>

    <style name="MyCustomTheme" parent="Theme.Sherlock">
    <item name="actionOverflowButtonStyle">@style/customOverflowButtonStyle</item>
        <item name="android:actionOverflowButtonStyle">@style/customOverflowButtonStyle</item>
    </style>
 <!-- overflow button style -->
 <style name="customOverflowButtonStyle" parent="Widget.Sherlock.ActionButton.Overflow">
 <item name="android:src">@drawable/ic_your_menu_moreoverflow_with</item>
    </style>
</resources>

2)Use the theme on application in android manifest file


<application
       
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/MyCustomTheme" >
        <activity
            android:name=".YourMainActivtiy"
           
            android:configChanges="orientation"
            android:label="app" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
</application

That’s all for changing overflow menu icon in Sherlock action bar
Changes looks like
device-2013-02-15-143813
Enjoy android styling 🙂

Advertisements

4 thoughts on “Styling ActionBarSherlock – change icon of overflow menu button

  1. Where should i put the lines shown in step 1? The second step is clear, offcourse in the Manifest. But wich file do you mean in step 1?

    Thanks!

  2. My app action bar overflow icon is dark..now i want to change to white color..Could please tell how to generate white overflow i con…

    • Do you mean you want to change the action bar color to the white or you want to change the overflow icon to white. if so change the icon color to white using photo edit tools

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s