安卓对话框按钮标题

9
使用Anko,我可以编写以下代码来显示对话框:
alert("Dialog title") {
   yesButton {}
   noButton {}
}.show()

我该如何为按钮设置标题?
noButton {title = "title"}

抱歉,它不起作用。
1个回答

17

你可以这样使用positiveButtonnegativeButton

alert("Dialog title") {
    positiveButton("Yes") { it.dismiss() }
    negativeButton("No") { it.dismiss() }
}.show()

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接