How to change the text color of Actionbar menu items?

Asked

Viewed 1,534 times

0

In addition to changing the text of the menu item, how do I change the background of the drop-down menu? In this case, what only appears when you click on the 3 dots.

  • Change to any color or enter Dark and Light of the system itself?

  • Any color, to differentiate from Actionbar!!

1 answer

2

I recommend you migrate from Actionbar to Toolbar. In Toolbar, you can change the popup theme that the menu item will open as action. Take a look at: http://developer.android.com/reference/android/widget/Toolbar.html

But if you choose to use Actiobar, you can do the following: 1) To change text color of the Action Menu Item:

<style>
    <item name="android:actionMenuTextAppearance">@style/MyTextStyle</item>
</style>

<style name="MyTextStyle" parent="android:style/TextAppearance.Holo.Widget.ActionBar.Title">
    <item name="android:textAppearance">@android:style/TextAppearance.Medium</item>
    <item name="android:textSize">14sp</item>
    <item name="android:textStyle">bold</item>
</style>

And to change the popup/dialog that the Menu Item will open, take a look at the 'Creating a Popup Menu' section of this link: http://developer.android.com/guide/topics/ui/menus.html#Popupmenu

I hope I helped. Good luck!

Browser other questions tagged

You are not signed in. Login or sign up in order to post.