Hello Guys,
If you are looking for creating Custom Spinner like this
Then I am here to help you :-)
If you are looking for creating Custom Spinner like this
Create an XML in drawable folder with any name for example spinner_bg.xml and add the following lines
<?xml version="1.0" encoding="utf-8"?><selector xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<layer-list>
<item>
<shape>
<stroke android:width="3dp" android:color="#ebebeb" />
<corners android:radius="5dp" />
<solid android:color="#fff"></solid>
</shape>
</item>
<item>
<bitmap android:gravity="bottom|right" android:src="@drawable/ic_arrow_drop_down" />
</item>
</layer-list>
</item>
</selector>
Add the following lines to your styles.xml which is inside values folderNow add this style to your spinner as<style name="spinner_style" > <item name="android:background">@drawable/spinner</item> <item name="android:popupBackground">#DFFFFFFF</item> </style>
<Spinner android:id="@+id/condition" style="@style/spinner_style" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="16dp" android:layout_marginRight="16dp" android:layout_marginTop="15dp" android:popupBackground="#cccccc" />
Thanks Saranya!! for appreciate my post.
ReplyDeleteLet me know if I can do anything else for you.