Is it possible to style an Android Spinner as in the image below with border and an arrow in it?
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>
you can use nine patch images. to customize spinner like below
Copyright © 2021 Jogjafile Inc.
I found a solution what I want to do as below.
and make a xml file in drawable folder and paste following code