Spinner
Overview
Drop-down selection box
Example
<Spinner android:layout_height="wrap_parent"
android:layout_width="match_parent"
android:tag="btn"
android:text="Option 1|Option 2"
android:textColor="#669999"
android:mode="dialog"
android:textSize="14dp"
android:defaultText="Option 2"
android:gravity="center"
/>
Properties
Common Properties
Private Properties
| Property | Description | Values |
|---|---|---|
| layout_weight | Child weight | Number When the parent is LinearLayout, child controls can set weight |
| gravity | Internal control alignment | Usage reference top bottom left right center_vertical fill_vertical center_horizontal fill_horizontal center fill clip_vertical clip_horizontal |
| text | Drop-down options | String Separate multiple options with pipe |, e.g.: Option 1|Option 2 |
| textColor | Text color | Hex, e.g. #FFFFFF |
| textSize | Text size | specific number + dp |
| defaultText | Default selected item | One of the items in text |
| mode | Display mode | dialog — dialog box; dropdown — drop-down mode |
| popupHeight | Popup height | specific number + dp |