0
A
回答
1
這個,如果你想要更多的自定義選項
alertDialogue.setContentView(/*Layout*/)
,或者如果你想要一些選擇使用此使用。
alertDialogue.setMultiChoiceItems(R.array.toppings, null,
new DialogInterface.OnMultiChoiceClickListener() {
@Override
public void onClick(DialogInterface dialog, int which,
boolean isChecked) {
if (isChecked) {
// If the user checked the item, add it to the selected items
mSelectedItems.add(which);
} else if (mSelectedItems.contains(which)) {
// Else, if the item is already in the array, remove it
mSelectedItems.remove(Integer.valueOf(which));
}
}
})
相關問題
- 1. 如何使用自定義視圖顯示單選AlertDialog?
- 2. AlertDialog的自定義視圖
- 3. 在AlertDialog中顯示自定義視圖
- 4. AlertDialog用的onCreate(自定義視圖)
- 5. 自定義列表視圖的AlertDialog
- 6. AlertDialog自定義視圖不出現
- 7. 菜單中的自定義AlertDialog?
- 8. 自定義AlertDialog
- 9. 如何自定義選取器視圖
- 10. android中的自定義alertDialog
- 11. 沒有自定義視圖的AlertDialog中的editText?
- 12. 如何在Android中的AlertDialog中包含自定義標題視圖?
- 13. android自定義列表視圖與自定義單選按鈕
- 14. 在AlertDialog的自定義視圖中訪問EditText
- 15. 自定義列表視圖中的單選複選框
- 16. 如何將自定義列表視圖添加到Android中的AlertDialog?
- 17. 如何在UITableView的選定行中添加自定義視圖?
- 18. 如何自定義ListBox中選定項目的視圖? (WP8)
- 19. 在AlertDialog中自定義ListView
- 20. 在Android中自定義AlertDialog
- 21. 自定義從AlertDialog
- 22. 在DialogFragment中爲AlertDialog充氣自定義視圖問題
- 23. 自定義視圖中的菜單
- 24. 如何在Android的自定義視圖中創建自定義視圖?
- 25. 在android自定義視圖中我如何編程我的自定義視圖?
- 26. 多選AlertDialog與自定義適配器
- 27. 自定義視圖 - 條件視圖 - ViewStub和單選按鈕
- 28. alertdialog與自定義適配器的列表視圖不顯示
- 29. Android:自定義AlertDialog,viewPager:java.lang.IllegalArgumentException:沒有找到id的視圖
- 30. 帶有Edittext的AlertDialog作爲自定義標題視圖
感謝快速回復,我實際上必須使用onSingleChoiceItems,所以你可以告訴我這樣做的正確方法? –
使用具有一個值的數組 –
我現在試試 –