Spinner

constructor(options: List<String>, selectedOption: String, onItemSelected: (String) -> Unit, style: Style = Style, @ColorInt selectedTextColor: Int = -0x22000000, selectedTextSize: Float = -1f, caret: Drawable? = null, @LayoutRes itemLayout: Int = android.R.layout.simple_dropdown_item_1line)

Parameters

options

The options available from the dropdown

selectedOption

The initially selected option for the spinner

onItemSelected

The listener for dropdown selections

style

The style for the spinner component

selectedTextColor

The text color of the selected value

selectedTextSize

The text size of the selected value

caret

The spinner caret icon i.e. arrow at the far right. Notice that this drawable will be flipped vertically when the dropdown menu is shown

itemLayout

The item layout for the drop down list android.R.layout.simple_dropdown_item_1line is used by default