3

I am using android spinner to show drop down options and i have customized its style and item style. It works fine but on lollipop it shows shadow like shown in the screenshot.

note 2 Nexus 5 spinner style is extended from the appCompat as below

<style name="spinner_style" parent="Widget.AppCompat.Light.Spinner.DropDown.ActionBar">

and setting these properties

   <item name="android:layout_width">fill_parent</item>
    <item name="android:layout_height">30dp</item>
    <item name="android:layout_marginTop">7dp</item>
    <item name="android:layout_marginLeft">@dimen/margin_extra_large</item>
    <item name="android:background">@color/white</item>
    <item name="android:layout_marginRight">0dp</item>
    <item name="android:popupBackground">@color/white</item>
    <item name="android:divider">@color/black</item>
    <item name="android:dividerHeight">@dimen/padding_basic_large</item>
    <item name="android:scrollbars">vertical</item>
    <item name="android:textColor">@color/login_edit_text_color</item>
    <item name="android:dropDownSelector">@color/app_background_color</item>
    <item name="android:scrollbarAlwaysDrawVerticalTrack">false</item>
    <item name="android:scrollbarTrackVertical">@color/app_background_color</item>

i am setting array adapter for spinner items as follow

adapter = new ArrayAdapter<String>(this, R.layout.list_item_ltdids,
           ids);
  adapter.setDropDownViewResource(android.R.layout.simple_dropdown_item_1line);

Any idea why its showing shadow on lollipop?

Note: i am using appcompat_21

SAIR
  • 1,121
  • 11
  • 31

1 Answers1

6

Remove the popupBackground property and try, it should work!

Prashant Patel
  • 1,087
  • 11
  • 18