How to change the Text color of Menu item in Android?
Master System Design with Codemia
Enhance your system design skills with over 120 practice problems, detailed solutions, and hands-on exercises.
Introduction
Changing menu item text color in Android depends on which menu you actually mean. An options menu in the app bar, a popup menu, and a navigation drawer menu are styled differently, so there is no single universal API that works for all of them.
In practice, the most common solutions are theme-based styling for popup-style menus and SpannableString for per-item text color changes. The right choice depends on whether you want a global style or a one-off override.
One-Off Color Change With SpannableString
If you want to change the color of a specific menu item title, a practical approach is to wrap the title in a SpannableString.
Kotlin example:
This is simple and reliable for a small number of items. It works well when you want one menu action, such as “Delete,” to stand out visually.
Styling Popup Menus Through Theme Attributes
For popup menus, theme styling is often cleaner than touching each item manually. A PopupMenu can use a themed context so its text appearance comes from styles.
Example popup menu:
And the style:
This is a better approach when you want a consistent popup-menu look across the app.
Options Menu in Toolbar-Based Apps
In modern Android apps, menu items are usually shown in a Toolbar rather than the old framework action bar. That means the overall menu appearance is influenced by the toolbar theme and text appearances.
Basic toolbar setup:
The popupTheme controls the overflow menu appearance. That is often the actual place to style text color for the menu you see when the user taps the three-dot overflow button.
Menu XML Example
Typical menu resource:
If you want all menu items to share a theme-based color, prefer styling. If you want one specific item to look different, prefer SpannableString.
When Icons Need Matching Color
Changing only the text color can make the menu look inconsistent if the icons still use the old tint. If your menu items have icons, tint them to match:
That is especially useful in destructive actions where both icon and label should communicate the same meaning.
Which Approach Should You Use
Use SpannableString when:
- only one or two items need custom color
- the styling is conditional at runtime
- you want a quick per-item solution
Use theme or text appearance styling when:
- many menu items should share the same style
- you are styling popup or overflow menus
- consistency across screens matters more than one-off customization
That balance keeps the code maintainable.
Common Pitfalls
One common mistake is changing the toolbar title color and expecting menu item text to change too. Those are different UI elements.
Another mistake is styling the app theme but forgetting that the overflow popup may be controlled by popupTheme instead of the main activity theme.
It is also easy to rely on old framework ActionBar examples in a modern AppCompat or Material app. In current Android code, Toolbar styling is usually the real answer.
Finally, if you recolor the text but not the icons, the menu can end up looking visually inconsistent.
Summary
- Menu item text color depends on the type of menu and how it is rendered.
- Use
SpannableStringfor one-off per-item color changes. - Use theme styling and
popupThemefor consistent popup and overflow menu text appearance. - In modern apps, menu styling is often really
Toolbarstyling. - Keep icon tint and text color aligned when the menu item has both.

