title: Android menu overlay background color
body: <p>So I was searching for a way to change my menu popup background color but I'm really out of ideas now...
  first, this is my toolbar:</p>
  
  <pre><code> &lt;android.support.v7.widget.Toolbar
      android:id="@+id/main_actionbar"
      android:layout_width="match_parent"
      android:layout_height="?attr/actionBarSize"
      android:elevation="2dp"
      app:elevation="2dp"
      app:theme="@style/MainActionBar"
      app:popupTheme="@style/MainActionBar.Popup"/&gt;
  </code></pre>
  
  <p>and the 2 themes I applied without any background changes:</p>
  
  <pre><code>&lt;style name="MainActionBar" parent="Widget.AppCompat.Light.ActionBar"&gt;
      &lt;item name="android:background"&gt;@color/primary&lt;/item&gt;
      &lt;item name="android:textColor"&gt;@android:color/white&lt;/item&gt;
      &lt;item name="android:textColorPrimary"&gt;@android:color/white&lt;/item&gt;
      &lt;item name="android:textColorSecondary"&gt;@android:color/white&lt;/item&gt;
  &lt;/style&gt;
  &lt;style name="MainActionBar.Popup" parent="Widget.AppCompat.PopupMenu"&gt;
      &lt;item name="android:textColor"&gt;@color/primary_text&lt;/item&gt;
  &lt;/style&gt;
  </code></pre>
  
  <p>This makes my item background color look blue because I set the primary and secondary color of my app to blue.</p>
  
  <p>One solution I found to change the item menu color to white is setting android:background to a white color in my MainActionBar.Popup which looks like this:</p>
  
  <p><a href="https://i.stack.imgur.com/0I3Ye.gif" rel="nofollow noreferrer">Widget.AppCompat.PopupMenu with android:background set to @android:color/white</a></p>
  
  <p>Although this does change the background color to white, it also renders the box behind the popup white before the animation starts, which ruins the animation.</p>
  
  <p>Another option is setting android:itemBackground to a white color which looks like this:</p>
  
  <p><a href="https://i.stack.imgur.com/9eb8L.gif" rel="nofollow noreferrer">Widget.AppCompat.PopupMenu with android:itemBackground set to @android:color/white</a></p>
  
  <p>As you can see the animation looks fine now but the item background isn't completely white...</p>
  
  <p>I tried android:popupBackground as well but it doesn't seem to have any effect.</p>
  
  <p>I know this is a question asked a lot but I've read dozens of them, so I maybe it's just that I don't see an obvious mistake... </p>