Change the text color of the popup menu

Hirak Chhatbar

I am using Theme.AppCompat.Light.NoActionBar theme. I am getting a white background for popup menu and also the color of menu item is white that makes it invisible. I tried many solutions with no success.

This is my styles.xml

<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
    <item name="android:actionMenuTextColor">#000000</item>
    <item name="android:textColorPrimary">@color/white</item>
    <item name="android:textColorSecondary">@color/white</item>
    <item name="android:popupMenuStyle">@style/PopupMenu</item>
    <item name="android:textAppearanceLargePopupMenu">@style/myPopupMenuTextAppearanceLarge</item>
    <item name="android:textAppearanceSmallPopupMenu">@style/myPopupMenuTextAppearanceSmall</item>
    <!-- Customize your theme here. -->
</style>

<style name="PopupMenu" parent="@android:style/Widget.PopupMenu">
    <item name="android:popupBackground">@android:color/white</item>
    <item name="android:textColor">#000000</item>
    <item name="android:textSize">12sp</item>
</style>

<style name="myPopupMenuTextAppearanceSmall" parent="@android:style/TextAppearance.DeviceDefault.Widget.PopupMenu.Small" tools:ignore="NewApi">
    <item name="android:textColor">#000000</item>
    <item name="android:textSize">15sp</item>
</style>

<style name="myPopupMenuTextAppearanceLarge" parent="@android:style/TextAppearance.DeviceDefault.Widget.PopupMenu.Large" tools:ignore="NewApi">
    <item name="android:textColor">#000000</item>
    <item name="android:textSize">25sp</item>
</style>

This is the toolbar

<android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@+id/toolbar"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:background="@color/toolbar"
    android:elevation="8dp"
    app:theme="@style/AppTheme"
    app:title="Troll Cricket" />
Riyaz Ahamed

Add these lines to your Toolbar.xml file.

app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"

This will allow you to have a dark toolbar and light-themed overflow menu.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How to change title text and buttons color WITHOUT changing action overflow menu text color in new Toolbar?

From Dev

how to change actionbar's menu item text color in material design

From Dev

How do I change POPUP Text of Menu without ID

From Dev

How to change background color popup menu android

From Dev

Change the action bar menu selected text color for appcompat

From Dev

Change default actionbar popup menu background color

From Dev

android popup menu text color (AppCompat)

From Dev

How to change the text color and size of a pop up menu in android?

From Dev

Cant change Popup Menu

From Dev

How can I change text color in a Semantic UI vertical menu?

From Dev

How to change popup color?

From Dev

Change background color of Spinner popup

From Dev

Android change popup menu text color

From Dev

Android toolbar overflow menu change text color and fill menu to the screen

From Dev

html menu change drop down text color only

From Dev

How to change appcompat autocomplete popup text color?

From Dev

How to Change the Background Color and Text Color of Bootstrap Navbar Dropdown-menu List Items After Menu Collapses

From Dev

Change popup menu style - not working

From Dev

Change Mouse Hover Popup Color

From Dev

How to change the color of menu text?

From Dev

How to change background color popup menu android

From Dev

How to change text color on OnMouseHover in a Dropdown Menu

From Dev

Change the color of the text in Toolbar menu

From Dev

How to change the text color of context menu item

From Dev

Android change popup menu text color

From Dev

html menu change drop down text color only

From Dev

In a popup, change text in a span

From Dev

Change the color of menu icon

From Dev

¿Change text color main menu android?

Related Related

  1. 1

    How to change title text and buttons color WITHOUT changing action overflow menu text color in new Toolbar?

  2. 2

    how to change actionbar's menu item text color in material design

  3. 3

    How do I change POPUP Text of Menu without ID

  4. 4

    How to change background color popup menu android

  5. 5

    Change the action bar menu selected text color for appcompat

  6. 6

    Change default actionbar popup menu background color

  7. 7

    android popup menu text color (AppCompat)

  8. 8

    How to change the text color and size of a pop up menu in android?

  9. 9

    Cant change Popup Menu

  10. 10

    How can I change text color in a Semantic UI vertical menu?

  11. 11

    How to change popup color?

  12. 12

    Change background color of Spinner popup

  13. 13

    Android change popup menu text color

  14. 14

    Android toolbar overflow menu change text color and fill menu to the screen

  15. 15

    html menu change drop down text color only

  16. 16

    How to change appcompat autocomplete popup text color?

  17. 17

    How to Change the Background Color and Text Color of Bootstrap Navbar Dropdown-menu List Items After Menu Collapses

  18. 18

    Change popup menu style - not working

  19. 19

    Change Mouse Hover Popup Color

  20. 20

    How to change the color of menu text?

  21. 21

    How to change background color popup menu android

  22. 22

    How to change text color on OnMouseHover in a Dropdown Menu

  23. 23

    Change the color of the text in Toolbar menu

  24. 24

    How to change the text color of context menu item

  25. 25

    Android change popup menu text color

  26. 26

    html menu change drop down text color only

  27. 27

    In a popup, change text in a span

  28. 28

    Change the color of menu icon

  29. 29

    ¿Change text color main menu android?

HotTag

Archive