Changing Overflow Icon In The Action Bar
Answer :
You can with a style, but you have to add it to the main Theme declaration.
<resources> <!-- Base application theme. --> <style name="Your.Theme" parent="@android:style/Theme.Holo"> <!-- Pointer to Overflow style ***MUST*** go here or it will not work --> <item name="android:actionOverflowButtonStyle">@style/OverFlow</item> </style> <!-- Styles --> <style name="OverFlow" parent="@android:style/Widget.Holo.ActionButton.Overflow"> <item name="android:src">@drawable/ic_action_overflow</item> </style> </resources>
You also can change it dynamically, which I go into detail about here:
Changing the Android Overflow menu icon programmatically
For those who can't get it to work try this WITHOUT the "android:" namespace.
<item name="actionOverflowButtonStyle">@style/OverFlow</item>
Change your custom overflow icon of Actionbar in styles.xml.
<resources> <!-- Base application theme. --> <style name=“MyTheme" parent="@android:style/Theme.Holo"> <!-- Pointer to Overflow style DONT forget! --> <item name="android:actionOverflowButtonStyle">@style/MyOverFlow</item> </style> <!-- Styles --> <style name="MyOverFlow" parent="@android:style/Widget.Holo.ActionButton.Overflow"> <item name="android:src">@drawable/ic_your_action_overflow</item> </style> </resources>
Put custom theme "MyTheme" in application tag of AndroidManifest.xml
<application android:name="com.example.android.MainApp" android:theme="@style/AppTheme"> </application>
Have fun.@.@
Comments
Post a Comment