There are five common methods of spinner objects used in Android mobile app development.
Usage 1: Static display of Spinner options in resource mode
Usage 2: Dynamically display the Spinner option in code mode
usage 3 : Display pictures and text at the same time
Usage 4: Mixed mode
I'm just here. For the use of usage 1 and Usage 3, the other way can be referred to the following blog, written very well.
Http://www.cnblogs.com/freeliver54/archive/2012/09/03/2668363.html
The preceding declaration variables and initialization are no longer described. We directly learn the following methods of use.
Note The string selection information in the drop-down box is stored in the XML file in the Resource value folder
< string name = "Spin_prompt" > Please select expense type </string > < String-array name = "Outaccount" > < it Em > Hydro </item > < item > Rent </item > < item > Taxi charge </item > < item ; Dietary costs </Item > < item > Other charges </item >
If there is a return button, you can return the button to the event that is added as follows:
Set category drop-down list by default Select the first item (the string information in the drop-down box is stored in addinaccount.xml) spintype.setselection (0);
The use of spinner controls in Android development