android - How to change the Text color of Spinner -
this question has reply here:
android: spinner widget's text color attribute hiding? 6 answersplease help me on changing text color of spinner.
try this
custom_spinner_item.xml
<?xml version="1.0" encoding="utf-8"?> <textview xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:gravity="top" android:singleline="true" android:textcolor="@color/iphone_text" />
in java code
spinner spncategory= (spinner)findviewbyid(r.id.my_spinner);
..
arrayadapter<string> adptspncategory = new arrayadapter<string>this,r.layout.custom_spinner_item, alcategoryname); adptspncategory.setdropdownviewresource(android.r.layout.simple_spinner_dropdown_item); spncategory.setadapter(adptspncategory); spncategory.setonitemselectedlistener(new onitemselectedlistener() { public void onitemselected(adapterview<?> arg0, view arg1,int arg2, long arg3) { } public void onnothingselected(adapterview<?> arg0) { } });
android spinner
No comments:
Post a Comment