我正在使用 android AlertDialog (setMultiChoiceItems) 来显示项目列表。如果我在 gradle 中使用目标 26,则没有分隔线,并且项目彼此非常接近。如果我使用 ListView,我可以放置一条分隔线,但对于项目之间的间距,我有同样的问题。
有什么建议么?
谢谢
基础集合MultiChoiceItems
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();