Created
November 28, 2017 19:17
-
-
Save noln/d33e432158a8240d2fb7cd5850092933 to your computer and use it in GitHub Desktop.
Alert dialog with Spinner in customView, using Anko (Kotlin)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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, countries) | |
} | |
} | |
} | |
}.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
countries
should probably beitems
, or vice versa.