我是
Android的新手.
目前我想显示一个Alert“对话框”,“OK”& “取消”按钮.
默认值为PositiveButton:Left,NegativeButton:Right
你能让我知道如何把PositiveButton移到右边NegativeButton到左边?
是否有任何机会/麻烦,如果否定按钮导致一个坏的声音,当按OK,如果我们将文本“OK”更改为NegativeButton& “取消”到PositiveButton.
我的代码:
AlertDialog.Builder builder = new AlertDialog.Builder(SUtils.getContext());
builder.setMessage("Confirmation?")
.setCancelable(false)
.setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
//Todo
dialog.cancel();
}
})
.setPositiveButton("OK", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
//TOdo
}
})
dialog = builder.create();
谢谢,
天使