我正在显示一个带有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;
}
}