Ne dérangez pas avec les tiroirs droit/gauche/....
Il suffit de définir un dessin de 9 patches comme arrière-plan qui limite le contenu interne.
<Spinner
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@drawable/you_spinner_drawable" />
En ce qui concerne la drawable 9-patch ont un regard sur les ressources Android ou cet exemple photo prise de this blog post (qui montre peu plus de détails sur la façon de faire une fileuse personnalisée):
Pour des informations sur dessinables 9-patch, consultez la documentation Android: http://developer.android.com/guide/topics/graphics/2d-graphics.html#nine-patch http://developer.android.com/tools/help/draw9patch.html
Bien sûr, vous pouvez également spécifier un fichier xml de liste d'états comme dessinable, par exemple.
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<!-- When disabled -->
<item android:state_enabled="false"
android:drawable="@drawable/your_disabled_spinner_drawable" />
<!-- When selected -->
<item android:state_pressed="true"
android:drawable="@drawable/your_selected_spinner_drawable" />
<!-- When not selected-->
<item
android:drawable="@drawable/your_default_spinner_drawable" />
</selector>
http://developer.android.com/guide/topics/resources/drawable-resource.html#StateList
J'utilise ArrayAdapter adapter_subject = new ArrayAdapter (ActivityName.this, android.R.layout. simple_spinner_dropdown_item, ArrayListData); \t spinner_name.setAdapter (adaptateur_subject); –