I want my Spinner
to have a black gradient background with white text on the left and a selector icon on the right (a white downwards pointing triangle). As I see i
I've done something similar to method 1 in my app. Basically you need to combine your selector with a layer-list:
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<layer-list>
<item>
<shape>
<gradient
android:startColor="#343434"
android:endColor="#171717"
android:angle="270" />
<stroke
android:width="1dp"
android:color="#ffffff" />
<corners
android:radius="4dp" />
<padding
android:left="3dp"
android:top="3dp"
android:right="3dp"
android:bottom="3dp" />
</shape>
</item>
<item
android:top="12dp"
android:right="15dp">
<bitmap android:src="@drawable/arrow_bitmap"
android:gravity="top|right" />
</item>
</layer-list>
</item>
</selector>
In my xml I also added a third layer containing a <shape>
that is invisible (i.e. its alpha is set to 0) but adds padding.