how to change Android overflow menu icon

2019-02-04 11:46发布

How do i change the Overflow Menu icon on the far right of the action bar as seen in the image below? My Holo theme specifies this 3 row black stack icon by default and i want something else. i can't seem to find a solution for this. I have looked at the documentation on http://developer.android.com/guide/topics/ui/menus.html but it doesn't seem to lend much help.

Thanks!

"ActionBar"

7条回答
爷、活的狠高调
2楼-- · 2019-02-04 12:37

If you are using AppCompat you can achieve by following code.

res/values/themes.xml

<style name="MyTheme" parent="@style/Theme.AppCompat.Light">
     <item name="android:actionOverflowButtonStyle">@style/ActionButtonOverflow</item>

      <!-- Support library compatibility -->
     <item name="actionOverflowButtonStyle">@style/ActionButtonOverflow</item>

</style>

      <style name="ActionButtonOverflow" parent="@style/Widget.AppCompat.ActionButton.Overflow">
            <item name="android:src">@drawable/ic_launcher</item>
        </style>

and in androidmanifest.xml

<application
    android:theme="@style/MyTheme" >
查看更多
登录 后发表回答