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> 

  1. 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> 
  2. 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

Popular posts from this blog

Are Regular VACUUM ANALYZE Still Recommended Under 9.1?

Can Feynman Diagrams Be Used To Represent Any Perturbation Theory?