Change Actionbar menu icon

Asked

Viewed 3,540 times

8

I want to change the menu icon for ActionBar, those 3 points that have as default option "Settings". I’ve tried for the Style creating a custom theme and there putting the new icon but it did not work.

<style name="CustomActivityTheme" parent="AppTheme">
    <item name="android:homeAsUpIndicator">@drawable/botaohome</item>
    <item name="android:actionButtonStyle">@drawable/actionbuttonwhite</item>
</style>

The homeAsUpIndicator It works perfectly, but the same thing didn’t happen with Action Button Style. Any hint ?

  • You talk put icon on the Settings button that comes as default?

  • That’s it! Some idea?

  • You can disable the action bar and activate a Toolbar. In it vc would have full control, color, icons and etc.

  • There’s another topic here, see <https://stackoverflow.com/questions/9733312/changing-overflow-icon-in-the-action-bar> I think this video might also help you <https://www.youtube.com/watch?v=ycpgcx_QB3Y>

1 answer

1

You can use a menu within an Item, ai in the item you define an icon

<item
        android:icon="@drawable/ic_opcoes"
        app:showAsAction="always"
        android:title="@string/comecar">
        <menu>

             //aqui coloca os itens que você quer dentro no menu

        </menu>
    </item>
  • It is not the Auncher icon that he wants to change, but those three dots that appear on the right side of the action bar that open menu options (overflow icon).

  • Ataa, hold on I think I’ve done it, I’ll look here and I’ll tell you

  • Take a look at yourself

  • It would be like this if it were a custom icon and not the standard Android icon for overflow action, which is more complicated to change (precisely because Android tries to keep it standard). What he wants is this: http://stackoverflow.com/questions/8506184/how-to-change-the-option-menu-icon-in-the-action-bar

  • That’s exactly what Piovezan said. Changing the color of this icon would also help me a lot if someone knew.

  • I’ll try that link.

Show 1 more comment

Browser other questions tagged

You are not signed in. Login or sign up in order to post.