Android PopupMenu how to change menu item text color?
Asked Answered
C

2

5

I have created style that change the popup menu background color and now i need to know how to change the menu item text color too. Below is the style i am using

<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>    
Chacha answered 19/1, 2015 at 3:37 Comment(0)
A
7

Apply this style code to your application/activity theme style

<item name="android:textColorPrimary">@android:color/white</item>
Applecart answered 27/9, 2017 at 9:51 Comment(2)
It's EXACTLY what I need!Apterygial
Follow me readyandroid.com or check more about popup menu readyandroid.com/popup-menu-with-iconApplecart
K
0

Question android popup menu text color might have answer which you need.

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

Koon answered 19/1, 2015 at 3:51 Comment(4)
Is that means i have to change theme? I need to use Holo theme. Anyway, I have resource not found error with <style name="AppTheme" parent="Theme.AppCompat.Light">Chacha
It just means you didn't use support library.Koon
So maybe this post, #14681228 would be useful.Koon
Check readyandroid.wordpress.com/… for menu text color and for many more readyandroid.wordpress.comApplecart

© 2022 - 2024 — McMap. All rights reserved.