Bobby W
Bobby W

Reputation: 824

Android, Changing Menu popup background color

I am trying to change the background color of the Popup menu in the action bar.

Everything that I try its always the same black color, that is by default.

This is what I have in my styles.xml

    <style name="AppTheme" parent="Theme.AppCompat">
        <item name="colorPrimary">@color/app_navbar_background</item>
        <item name="colorPrimaryDark">@color/app_navbar_background</item>
        <item name="colorAccent">@color/CadetBlue</item>
        <item name="android:textColorSecondary">@color/black</item>
        <item name="android:popupMenuStyle">@style/PopupMenu</item>
    </style>

    <style name="PopupMenu" parent="@android:style/Widget.PopupMenu">
        <item name="android:popupBackground">@color/MediumPurple</item>
    </style>

And I do have the theme set in the AndroidManifest.xml

<application
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >

Does anybody know what I could be doing wrong

Upvotes: 0

Views: 753

Answers (1)

amaiaeskisabel
amaiaeskisabel

Reputation: 344

Try using this:

<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat">
    <!-- Customize your theme here. -->
    <item name="android:itemBackground">@color/app_navbar_background</item>
</style>

Upvotes: 3

Related Questions