Android PopupMenu, how to change the text color of a menu item?

I created a style that changes the background color of the popup menu, and now I need to know how to change the text color of the menu item. Below is the style I use

<style name="AppTheme" parent="android:Theme.Holo">
    <item name="android:popupMenuStyle">@style/PopupMenu</item>
</style>

<style name="PopupMenu" parent="@android:style/Widget.PopupMenu">
    <item name="android:popupBackground">@color/popup_menu_bg_color</item>
</style>    
+4
source share
2 answers

Apply this style code to the style of your application / activity theme

<item name="android:textColorPrimary">@android:color/white</item>
+2
source

The question text color in the Android context menu may have the answer you need.

If you use TextAppearance.AppCompat.Base.Widget.PopupMenu, you can use TextAppearance.AppCompat.Light.Widget.PopupMenu instead.

0
source

All Articles