How to change color of the overflow button in the main toolbar?

When the main toolbar is full, some actions could end up in the overflow menu. Overflow button has white color by default. We’ll explain how to change this default color to better fit your theme below.

Change Color Programmatically

Overflow button color can be changed programmatically inside your activity:

val mainToolbar = findViewById( as MainToolbar
mainToolbar.overflowIcon?.colorFilter = PorterDuffColorFilter(color, PorterDuff.Mode.SRC_ATOP)

Change Color In Theme

You can also change the overflow button color in your activity theme:

<!-- Set custom style for overflow button in your theme. -->
<item name="android:actionOverflowButtonStyle">@style/OverflowButtonStyle</item>


<!-- Extend the overflow button style with different tint color. -->
<style name="OverflowButtonStyle" parent="Widget.AppCompat.ActionButton.Overflow">
    <item name="tint">@color/custom_overflow_button_color</item>

If you are not yet using custom theme, refer to Defining a Custom Theme guide.