android - how can i change spinner background color? -
how can change spinner background color ?
this black color style .
how can change style color spinner pop up?
i want change background color white in place of black how can change ?
spinnner
<spinner android:id="@+id/spinner" android:layout_width="100dp" android:layout_margintop="1dp" android:layout_height="wrap_content" android:background="@drawable/spinner_bg" android:layout_marginleft="1dp"/>
spinnerbg.xml
<?xml version="1.0" encoding="utf-8"?> <layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <item> <color android:color="@color/inputbg1" /> </item> <item android:gravity="center_vertical|right" android:right="8dp"> <layer-list> <item android:width="12dp" android:height="12dp" android:background="#fff" android:gravity="center" android:bottom="10dp"> <rotate android:fromdegrees="45" android:todegrees="45"> <shape android:shape="rectangle"> <solid android:color="#ffffff" /> <stroke android:color="#ffffff" android:width="1dp"/> </shape> </rotate> </item> <item android:width="20dp" android:height="10dp" android:bottom="21dp" android:background="#fff" android:gravity="center"> <shape android:shape="rectangle"> <solid android:color="@color/inputbg1"/> </shape> </item> </layer-list> </item> </layer-list>
try this..change style in in res/values/styles.xml::-
<resources> <style name="appbasetheme" parent="android:theme.light"> </style> <style name="apptheme" parent="appbasetheme"> <item name="android:spinnerdropdownitemstyle">@style/myspinneritemstyle</item> </style> <style name="myspinneritemstyle" parent="@android:style/widget.holo.dropdownitem.spinner"> <item name="android:textcolor">@android:color/white</item> </style>
Comments
Post a Comment