Spinners provide a quick way to select one value from a set. In the default state, a spinner shows its currently selected value. Touching the spinner displays a dropdown menu with all other available values, from which the user can select a new one.
You can add a spinner to your layout with the
Spinner object. You should usually do so in your XML layout with a <Spinner> element. For example:<Spinner android:id="@+id/planets_spinner" android:layout_width="fill_parent" android:layout_height="wrap_content" />
To populate the spinner with a list of choices, you then need to specify a
SpinnerAdapter in your Activity or Fragment source code.
Key classes are the following:
Comments
Post a Comment