Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change color of the overflow button on ActionBar

Is it possible to change the color of the overflow button(3 vertical dots) on the action bar? If so, how do we do that? I didn't find any style for overflow button.

Thanks

like image 268
Gaurav Avatar asked Jul 11 '12 04:07

Gaurav


People also ask

How do I customize my action bar?

This example demonstrate about how to create a custom action bar in Android. Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project. Step 2 − Add the following code to res/layout/activity_main. xml.

Where is the action overflow menu icon?

The right-hand side of the action bar shows the actions. The action buttons (3) show the most important actions of your app. Actions that do not fit in the action bar are moved to the action overflow, and an overflow icon appears on the right.


2 Answers

You can change the image used for it using the following style declaration.

<style name="MyCustomTheme" parent="style/Theme.Holo">     <item name="android:actionOverflowButtonStyle">@style/MyCustomTheme.OverFlow</item> </style>  <style name="MyCustomTheme.OverFlow">     <item name="android:src">@drawable/my_overflow_image</item> </style> 

And if you're using ActionBarSherlock, here's how to do it

<style name="MyCustomTheme" parent="style/Theme.Sherlock">     <item name="android:actionOverflowButtonStyle">@style/MyCustomTheme.OverFlow</item>     <item name="actionOverflowButtonStyle">@style/MyCustomTheme.OverFlow</item> </style>  <style name="MyCustomTheme.OverFlow">     <item name="android:src">@drawable/my_overflow_image</item> </style> 
like image 190
XGouchet Avatar answered Sep 22 '22 00:09

XGouchet


Some of these answers are serious overkill and some give limited results. The answer is much simpler. You can set it to whatever color you want, any time. Here:

toolbar.getOverflowIcon().setColorFilter(colorInt, PorterDuff.Mode.SRC_ATOP); 
like image 35
Peter Griffin Avatar answered Sep 23 '22 00:09

Peter Griffin