Set spinner style

This is simple to do in xml. This example makes the spinner look like an edit text.

In styles xml file add

<style parent="@android:style/Widget.Spinner" name="SpinnerAsEditText"><item name="android:background">@android:drawable/edit_text</item>
</style>

In layout file add spinner.

 <Spinner
        android:id="@+id/spinner1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        style="@style/SpinnerAsEditText" />

 

This entry was posted in Android. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *