Android AlertDialog分频器无处可见

时间:2016-02-27 01:49:12

标签: android alertdialog divider

我正在显示一个带有AlertDialog和简单列表的简单DialogFragment。

public Dialog onCreateDialog(Bundle savedInstanceState) {
      AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
      builder.setItems(times, new DialogInterface.OnClickListener() {
        public void onClick(DialogInterface dialog, int which) {
        }
      });
      builder.setTitle("Select an end date");
      AlertDialog alertDialog = builder.create();
      ListView listView = alertDialog.getListView();
      listView.setDivider(new ColorDrawable(Color.BLACK));
      listView.setDividerHeight(1);
      return alertDialog;
    }
  }

但是你可以在下面的图片中看到,并非所有的潜水员都是黑色的? 有人可以帮助我在物品之间获得正常的分隔线吗? enter image description here

0 个答案:

没有答案