Wednesday, 15 August 2012

Change spinner style (Android)


You must create a new xml file. spinner.xml

spinner_pressed and spinner_normal are the images and they should end with .9.png

<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
     <item
           android:state_pressed="true"
           android:drawable="@drawable/spinner_pressed" />
     <item
           android:drawable="@drawable/spinner_normal" />
</selector>

After that put this where is declar Spinners

<Spinner
.....  
android:background="@drawable/spinner.xml"
.....
/> 

1 comment:

  1. It's interesting that many of the bloggers your tips helped to clarify a few things for me as well as giving... very specific nice content.Android Training institute in chennai with placement | Best Android Training in velachery

    ReplyDelete