Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Anko dialog button title

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.

like image 497
glnix Avatar asked Feb 07 '17 05:02

glnix


1 Answers

You can use positiveButton and negativeButton like so:

alert("Dialog title") {
    positiveButton("Yes") { it.dismiss() }
    negativeButton("No") { it.dismiss() }
}.show()
like image 104
miensol Avatar answered Sep 25 '22 13:09

miensol