When defining a spinner in code, you can set the mode to 'dialog' or 'dropdown':
Spinner(Context context, int mode) Construct a new spinner with the given context's theme and the supplied mode of displaying choices.
But I can't find this option when defining my layout in XML. Did I just miss it, or is this not possible in XML?
To use
SpinnerMode
Xml attribute and work on API Level 11 or higher.you need to create your own style for spinner.
1] put in
themes.xml
file invalues
Folder :2] put in
themes.xml
file invalues-v11
Folder andvalues-v14
Folder :3] then use your style in
Spinner
xml tagNo, according to the reference found here this is not possible. There is no corresponding XML attribute listed. Like other things as setting 24h mode for a timepicker, which is not possible in XML.
If you're using the API level 10 or lower just remove android:spinnerMode and style from your XML file.
As of API level 11, you can use
or