Open carlastabile opened 7 years ago
You can specify an ArrayAdapter as you would any other spinner in Kotlin.
Try this:
// Items for spinner
val items = arrayOf("One", "Two", "Three", "Four", "Five")
// Alert with a spinner
alert("Example Alert") {
title = "Example Alert"
customView {
verticalLayout {
spinner {
adapter = ArrayAdapter(ctx, android.R.layout.simple_spinner_dropdown_item, items)
}
}
}
}.show()
I'm trying to add a Spinner inside an alert but there's no example or documentation on how to use spinners. How to populate it with items?
This is my code so far