Reputation: 1560
Is it possible to style an Android Spinner as in the image below with border and an arrow in it?
Upvotes: 0
Views: 1264
Reputation: 1560
I found a solution what I want to do as below.
<Spinner
android:id="@+id/genderBox"
android:layout_width="match_parent"
android:layout_height="30dp"
android:background="@drawable/my_spinner"
/>
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item>
<shape>
<solid android:color="@android:color/white" />
<stroke
android:width="1dp"
android:color="#d2d2d2" />
<padding
android:bottom="0dp"
android:left="0dp"
android:right="10dp"
android:top="0dp" />
</shape>
</item>
<item>
<bitmap
android:gravity="end"
android:src="@drawable/dropdown_arrow" />
</item>
</layer-list>
Upvotes: 2
Reputation: 2577
you can use nine patch images. to customize spinner like below
Upvotes: 3