30

I have been working on updating my apps to Material Design.

I have an app that uses tabs. For some reason whenever I use android:popupBackground to set the drop down menu color it freaks out.

https://i.imgur.com/Qm2NDYH.png

I set up a default project with tabs and used the following theme and the same thing happened. Has anyone one else had this problem? My app is open source and so all the code is available here GitHub

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
        <item name="actionDropDownStyle">@style/Dropdown</item>
    </style>
    <style name="Dropdown" parent="Widget.AppCompat.Light.Spinner.DropDown.ActionBar">
        <item name="android:popupBackground">#000</item>
        <item name="android:paddingLeft">32dp</item>
        <item name="android:paddingRight">32dp</item>
    </style>
</resources>
Avadhani Y
  • 7,566
  • 19
  • 63
  • 90
AquaMorph
  • 497
  • 3
  • 7
  • 14
  • 7
    Framework bug that has been already fixed for a future release. You can use a drawable background with rounded corners as a temporary workaround. The default popup menu background uses 2dp rounded corners, so this will match up better anyway. – alanv Nov 06 '14 at 07:15
  • 3
    I postet a workaround here: http://stackoverflow.com/questions/28013120/spinner-graphical-bug-api-21/28836851#28836851 – Patrick Dorn Mar 03 '15 at 16:31
  • try to disable hardwareacceleration http://developer.android.com/guide/topics/graphics/hardware-accel.html – Alessandro Verona Sep 03 '15 at 10:54
  • I think that this was resolved in latest AppCompat, described here: http://stackoverflow.com/questions/32066277/how-do-i-set-a-different-theme-for-a-spinners-dropdown/32066279#32066279 – TomaszRykala Sep 20 '15 at 12:55

1 Answers1

1

I had faced a similar issue with spinner. As @alanv mentioned use shape as background instead of colour will solve the problem.

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corners android:radius="2dp" />
<solid android:color="#000000" />
</shape>

UPDATE It is resolved in latest AppCompat.

SAIR
  • 1,121
  • 11
  • 31