Anko Button Select Button

With Anko, I can write something like this to show a dialog:

alert("Dialog title") {
   yesButton {}
   noButton {}
}.show()

How can I set the title for a button?

noButton {title = "title"}

does not work.

+4
source share
1 answer

You can use positiveButtonit negativeButtonlike this:

alert("Dialog title") {
    positiveButton("Yes") { dismiss() }
    negativeButton("No") { dismiss() }
}.show()
+5
source

Source: https://habr.com/ru/post/1669008/


All Articles