Spinner arrow fades when I change the background color

When I change the background color of my counter, the drop-down arrow disappears. I saw some answers to similar questions here, but they really do not address how to make the arrow "reappear" or change the color of the arrow directly from XML (if possible).

I am trying to make the arrow white, but the spinner (using the code below) still appears without the arrow.

<Spinner android:id="@+id/eventSpinner" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_alignParentLeft="true" android:layout_alignParentStart="true" android:layout_alignParentTop="true" android:background="@android:color/holo_green_dark" android:dropDownSelector="#ffffff" android:popupBackground="@android:color/holo_green_dark" android:spinnerMode="dropdown" /> 

Any help would be greatly appreciated. Thanks in advance.

+4
source share
1 answer

You can draw a string using xml code. as below

  <item > <layer-list> <item> <shape android:shape="rectangle" > <solid android:color="@android:color/transparent" /> <!-- background color of box --> </shape> </item> <item android:left="-2dp" android:right="-2dp" android:top="-2dp"> <shape> <solid android:color="@android:color/transparent" /> <stroke android:width="1dp" android:color="#323232" /> <!-- color of stroke --> </shape> </item> <item android:right="5dp"> <bitmap android:gravity="center_vertical|right" android:src="@drawable/downlarrow" /> </item> </layer-list> </item> 

the output looks something like this: enter image description here

0
source

All Articles