Skip to content Skip to sidebar Skip to footer

Change The Action Bar Settings Icon Color

How can one change the color of the overflow icon in the action bar? (The most right icon)

Solution 1:

You can use something like this

<stylename="MyTheme"parent="android:style/Theme.Holo.Light"><itemname="android:actionOverflowButtonStyle">@style/MyActionButtonOverflow</item></style><stylename="MyActionButtonOverflow"parent="android:style/Widget.Holo.ActionButton.Overflow"><itemname="android:src">@drawable/my_action_bTutton_overflow</item></style>

in your AndroidManifest.xml

<applicationandroid:theme="@style/MyTheme" >

If you want to change actionBar color @style/MyActionBar

<!-- Support library compatibility --><itemname="actionBarStyle">@style/MyActionBar</item></style><!-- ActionBar styles --><stylename="MyActionBar"parent="@style/Widget.AppCompat.Light.ActionBar.Solid.Inverse"><itemname="android:background">@color/app_theme_color</item><!-- Support library compatibility --><itemname="background">@color/app_theme_color</item><itemname="android:alwaysDrawnWithCache">true</item><itemname="android:displayOptions">showTitle|showHome|homeAsUp</item><itemname="android:icon">@android:color/transparent</item></style>

Then in your AndroidManifest.xml you need to refer this one inside your application tag.

    android:theme="@style/CustomActionBarTheme"

Solution 2:

If you just want to change the color you can simply tint it:

<stylename="DotsDarkTheme"parent="@style/Widget.AppCompat.ActionButton.Overflow" ><itemname="android:tint">@color/yourColor</item></style>

and then use it in your style:

<itemname="actionOverflowButtonStyle">@style/DotsDarkTheme</item>

Solution 3:

if you are using action bar use :

        toolbar.getOverflowIcon().setColorFilter(Color.WHITE , PorterDuff.Mode.SRC_ATOP);

Solution 4:

It's also worth adding that if you simply want to change the overflow button to a light or dark colour to go with your action bar colour this can be done without specifying a custom icon.

For a dark button colour set your theme as:

<stylename="MyTheme"parent="@style/Theme.AppCompat.Light"><itemname="android:actionBarStyle">@style/MyTheme.ActionBar</item></style>

Theme.Holo.Light

For a light button colour add DarkActionBar:

<stylename="MyTheme"parent="@style/Theme.AppCompat.Light.DarkActionBar"><itemname="android:actionBarStyle">@style/MyTheme.ActionBar</item></style>

Theme.Holo.Light.DarkActionBar

If, like me, you want a light button colour but you want the overflow menu to be light you can do the following:

<stylename="MyTheme"parent="@style/Theme.AppCompat.Light.DarkActionBar"><itemname="android:actionBarStyle">@style/MyTheme.ActionBar</item><itemname="android:actionBarWidgetTheme">@style/MyTheme.ActionBarWidget</item></style><!-- This helps the PopupMenu stick with Light theme while the ActionBar is in Dark theme --><stylename="MyTheme.ActionBarWidget"parent="android:Theme.Holo.Light"><itemname="android:popupMenuStyle">@android:style/Widget.Holo.Light.PopupMenu</item><itemname="android:dropDownListViewStyle">@android:style/Widget.Holo.Light.ListView.DropDown</item></style>

Solution 5:

You can use your custom style inside for menu item, like this

<item name="android:itemTextAppearance">@style/myCustomMenuTextApearance</item>

Define the style like this:

<stylename="myCustomMenuTextApearance"parent="@android:style/TextAppearance.Widget.IconMenu.Item"><itemname="android:textColor">@android:color/primary_text_dark</item></style>

Also see Change the background color of the options menu and

Android: customize application's menu (e.g background color)

Post a Comment for "Change The Action Bar Settings Icon Color"