Anko dialog button title
Asked Answered
R

1

9

With Anko, I can write something like this for showing dialog:

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

How can I set a title for the button?

noButton {title = "title"}

Unfortunately, it doesn't work.

Refrigerant answered 7/2, 2017 at 5:28 Comment(0)
T
17

You can use positiveButton and negativeButton like so:

alert("Dialog title") {
    positiveButton("Yes") { it.dismiss() }
    negativeButton("No") { it.dismiss() }
}.show()
Traci answered 7/2, 2017 at 6:25 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.