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
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>
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);
XGouchet's answer is great, but just wanted to add that if you inherit from an existing style you'll get the standard padding, selected state, etc.
<style name="MyCustomTheme.OverFlow" parent="Widget.Sherlock.ActionButton.Overflow">
<item name="android:src">@drawable/title_moreicon</item>
</style>
Other programmatically option:
Drawable drawable = toolbar.getOverflowIcon();
if(drawable != null) {
drawable = DrawableCompat.wrap(drawable);
DrawableCompat.setTint(drawable.mutate(), getResources().getColor(R.color.thecolor));
toolbar.setOverflowIcon(drawable);
}
Hope it helps!
If you are using AppCompat , you could derive a new custom style with the attribute android:textColorSecondary
set to the required color, and use it as the theme for your toolbar.
Android: Changing the Toolbar’s text color and overflow icon color