android - How to customize spinner box? -
i want spinner dropdown below images,
i created below this
xml
layout:
<spinner android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginleft="10dp" android:layout_marginright="10dp" android:layout_margintop="20dp" android:background="@drawable/edittext_shape" android:padding="10dp" android:paddingleft="4dp" android:id="@+id/rol_type" android:layout_marginbottom="2dp">
spinner shape
<?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item><layer-list> <item><shape> <gradient android:angle="90" android:startcolor="@color/white" android:endcolor="@color/appblue" /> <stroke android:width="1dp" android:color="@color/block" /> <corners android:radius="4dp" /> <!-- <padding android:bottom="3dp" android:left="3dp" android:right="3dp" android:top="3dp" />--> </shape></item> <item ><bitmap android:gravity="right|bottom|end" android:src="@drawable/drop_arrow" android:tint="@color/red" /> </item> </layer-list></item> </selector>
my output:
i want below please me in case:
try this: changed background style. can extend style , add own elements https://developer.android.com/guide/topics/ui/look-and-feel/themes.html
<spinner android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginleft="10dp" android:layout_marginright="10dp" android:layout_margintop="20dp" style="@android:style/widget.holo.light.spinner" android:padding="10dp" android:paddingleft="4dp" android:id="@+id/rol_type" android:layout_marginbottom="2dp">
Comments
Post a Comment