Android menu background black with Theme.AppCompat?
What I did was I change my popUpTheme to DayNight so use
app:popupTheme="@style/ThemeOverlay.AppCompat.DayNight">
`
You can just use appNS to define the popupTheme as shown below.
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
You can change the background color of the popup menu as below.
Create a style in your styles.xml
<style name="PopupMenuStyle" parent="Theme.AppCompat.Light"> <item name="android:background">@android:color/white</item> </style>
Set this theme as your
toolbar
popup theme in yourtoolbar.xml
<android.support.v7.widget.Toolbar xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:android="http://schemas.android.com/apk/res/android" // Your code here app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" app:popupTheme="@style/PopupMenuStyle" />
Hope this helps.
Refer this link
The accepted answer here worked for me. I am just repeating the same answer here again. Add the following to your Toolbar xml
<android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@color/toolbarbackground"
android:elevation="4dp"
app:popupTheme="@style/YOUR_THEME_HERE"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
>
In your styles.xml:
<style name="YOUR_THEME_HERE" parent="ThemeOverlay.AppCompat.Light">
<item name="android:colorBackground">#000000</item>
<item name="android:textColor">#ffffff</item>
</style>
The above style gives white font on a black background.
Credit to #Eugen Pechanec