I\'m trying to styling my appcompat-v7 toolbar to have a different background color for my overflow menu. I tried to use the themes for my app and styles for my toolbar, bu
Add this to your toolbar element
app:popupTheme="@style/ThemeOverlay.YourPopup"
Then in your styles.xml
define the popup menu style
Note that you need to use android:colorBackground
and never android:background
. The latter would be applied to everything that doesn't have a background (here the menu itself and each menu item), the former applies only to the popup menu.
Update: The same applies to textColorPrimary
and textColor
.
android:textColor="?android:textColorPrimary"
.android:textColorPrimary
is a theme attribute, it's defined on themes.android:textColor
is a style attribute, it's defined on widgets.android:textColor
in a theme, it would be applied to every widget that doesn't define its own android:textColor
.