Thursday, January 2, 2014

Change Spinner Text Size and Color

Make custom xml file for your spinner item.
spinner_item.xml:
give your customized color and size to text in this file.
<?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="wrap_content"
    android:textSize="20dip"
    android:gravity="left"  
    android:textColor="#FF0000"         
    android:padding="5dip"
    />
Now use this file to show your spinner items like:
ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, R.layout.spinner_item,list);
Found on
http://stackoverflow.com/questions/9476665/how-to-change-spinner-text-size-and-text-color


No comments:

Post a Comment