我想显示两个按钮的警报:“Reprendre”和“Plus Tard”。我有下面的代码:AlertDialog只显示两个按钮中的一个
alertsyncincomplete = new AlertDialog.Builder(this);
alertsyncincomplete.setCustomTitle(titleAlertSyncIncomplete);
alertsyncincomplete.setPositiveButton("Reprendre", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
}
});
alertsyncincomplete.setNegativeButton("Plus tard", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
}
});
但是我能看到的只是屏幕上的一个按钮 - 文本“Reprendre”第一个。我用AlertDialog
与setButton
和setButton2
方法,我得到了相同的结果。我将文本“Plus Tard”改为“OK”(长度较短),然后显示两个按钮。我认为问题应该与文本的长度有关(即使我按钮上的文本不是很长)。
我该如何解决这个问题?