Search code examples
androidandroid-spinner

How to change spinner button color in Android?


I'm trying to change the spinner button color in Android but I can't get it working. Can anyone help?

  <Spinner
       android:id="@+id/spinner1"
       android:layout_width="200dp"
       android:layout_height="35dp"
       android:layout_marginTop="2dp"
       android:background="@null"
       android:layout_weight="1"
       android:layout_marginLeft="11dp"

       android:layout_alignParentBottom="true"
       android:layout_alignParentRight="true"

/>

Solution

  • I'm not a android specialist but does this help you?: The Spinner button uses a nine-patch image (http://www.aspose.com/java/imaging-component.aspx). You need to make a nine-patch image in all the different resolutions and then set it as the spinner's background.

    See: http://developer.android.com/tools/help/draw9patch.html