我正在使用android AlertDialog(setMultiChoiceItems)来显示项目列表。 如果我在gradle中使用目标26,则没有分隔线,并且这些项目彼此非常接近。 如果我使用ListView,我可以放一个separetion行,但我对项目之间的间距有同样的问题。
有什么建议吗?
由于
base setMultiChoiceItems
adb_scelta = new AlertDialog.Builder(MainActivity.this);
adb_scelta.setTitle(getResources().getText(R.string.adb_scelta_title));
adb_scelta.setMultiChoiceItems(lista_con_num, selections,new DialogSelectionClick());
adb_scelta.setPositiveButton(getResources().getText(R.string.prosegui_min), new ClickPositiveButton());
adb_scelta.create();
adb_scelta.show();
ListView setMultiChoiceItems
final CharSequence[] tags =lista_con_num;
adb_scelta = new AlertDialog.Builder(MainActivity.this);
adb_scelta.setMultiChoiceItems(tags, selections,new DialogSelectionClick());
adb_scelta.setPositiveButton(getResources().getText(R.string.prosegui_min), new ClickPositiveButton());
AlertDialog alertDialogObject = adb_scelta.create();
ListView listView_=alertDialogObject.getListView();
listView_.setDivider(new ColorDrawable(ContextCompat.getColor(getBaseContext(), R.color.Grigio_leggero))); // set color
listView_.setDividerHeight(2); // set height
alertDialogObject.show();