how to set dropdown arrow in spinner with background?

June 02, 2017 , 0 Comments

this is have 2 type we can achieve this:

TYPE 1 : Without using any dropdown images and JUST COPY & PAST
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<color android:color="#FFFFFF" />
</item>
<item
android:gravity="center_vertical|right"
android:right="8dp">
<layer-list>
<item
android:width="12dp"
android:height="12dp"
android:bottom="10dp"
android:gravity="center">
<rotate
android:fromDegrees="45"
android:toDegrees="45">
<shape android:shape="rectangle">
<solid android:color="#FFF" />
<stroke
android:width="1dp"
android:color="#000000" />
</shape>
</rotate>
</item>
<item
android:width="30dp"
android:height="10dp"
android:bottom="21dp"
android:gravity="center">
<shape android:shape="rectangle">
<solid android:color="#FFFFFF" />
</shape>
</item>
</layer-list>
</item>
</layer-list>

TYPE 2 : Set Your Image on dropdown ICON (NOTE : HERE down_arrow is your images )
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">

<item>

<layer-list>

<item>
<color android:color="@android:color/white" />
</item>

<item>
<bitmap android:gravity="center_vertical|right" android:src="@drawable/down_arrow" />
</item>

</layer-list>

</item>

</selector>

 

Contributer

Some say he’s half man half fish, others say he’s more of a seventy/thirty split. Either way he’s a fishy bastard. Google

0 comments:

Popular Posts