将android布局中按钮右移,Android AlertDialog将PositiveButton移到右边,NegativeButton在左边...

我是

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();

谢谢,

天使

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值