October 21, 2024
Chicago 12, Melborne City, USA
Android

Unable to change Overflow icon color in my Toolbar


In my gradle I’m using material 1.12 acording to various article it is somehow possible to style the threedots icon used as overflow menu for my toolbar (top) this is what I have defined in my style, as you can see I have set various colors to try hit the right one:

<style name="App.Theme" parent="Theme.MaterialComponents.DayNight.NoActionBar">
    <item name="android:actionBarStyle">@style/App.Theme.Popup</item>
    <item name="toolbarStyle">@style/App.Theme.Popup</item>
</style>

<style name="App.Theme.Popup" parent="@style/Widget.MaterialComponents.Toolbar.Primary">
    <item name="popupTheme">@style/PopupMenuStyle</item>

    <item name="android:textColor">#fff</item>
    <item name="android:textColorPrimary">#fff</item>

    <item name="colorPrimary">#00ff00</item>
    <item name="colorPrimaryVariant">#ffff00</item>
    <item name="colorOnPrimary">#00ffff</item>

    <item name="colorControlNormal">#fff</item>

    <item name="android:textColorSecondary">#fff</item>
    <item name="android:tint">#fff</item>
</style>

<style name="PopupMenuStyle" parent="Widget.AppCompat.PopupMenu.Overflow">
    <item name="android:iconTint">#fff</item>
</style>

The overflow icon color remains unchanged, however if I set App.Theme.Popup directly on my Toolbar layout, it works. This suggest me the property toolbarStyle and android:actionBarStyle are ignored and the theme is not correctly linked.

How can I set the color for the overflow menu icon, using themes?



You need to sign in to view this answers

Leave feedback about this

  • Quality
  • Price
  • Service

PROS

+
Add Field

CONS

+
Add Field
Choose Image
Choose Video