我想知道如何在“警报对话框”中水平滚动设置“列表项”。我的文字太长,我不想再下一行。
这是我目前添加商品的方式:
AlertDialog.Builder builder = new AlertDialog.Builder(ContextActivity);
builder.setTitle(dialogTitel);
final CharSequence[] aList = new CharSequence[items.size()];
Integer i = 0;
for (Map.Entry<Integer, String> entry : items.entrySet()) {
sDescription = entry.getValue();
aList[i] = sDescription;
i++;
}
builder.setItems(aList, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialogInterface, int item) {
CharSequence sDescription = aListe[item];
Integer iId = 0;
for (Map.Entry<Integer, String> entry : items.entrySet()) {
if (entry.getValue() == sDescription) {
iId = entry.getKey();
}
}
OnDialogSelected(iId, sDescription, button);
}
});