警报对话框不显示单选按钮 [英] Alert Dialog doesn't show radio buttons
本文介绍了警报对话框不显示单选按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个alertDialog
,代码如下:
AlertDialog.Builder b = new AlertDialog.Builder(Activity.this);
String[] types = getResources().getStringArray(R.array.text_spinner_NewClass_dayList);
b.setSingleChoiceItems(types, 2, (dialog, which) -> {
textView.setText(types[which]);
dialog.dismiss();
}
);
b.show();
我要显示项目的所有单选按钮,可它只显示所选项目。
xml
根据需要创建推荐答案布局。并通过"查看"将该布局放大到警报对话框。
AlertDialog.Builder b = new AlertDialog.Builder(Activity.this);
//Your customized layout
final View customLayout = getLayoutInflater().inflate(R.layout.custom, null);
b.setView(customLayout);
b.show();
这篇关于警报对话框不显示单选按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文