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
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.
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.
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);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With