2

我如何在 DatePicker 对话框中重命名默认按钮(“SET”)?

我的对话:

case IDD_SET_NAME:
final Calendar c = Calendar.getInstance();
myYear = c.get(Calendar.YEAR);
myMonth = c.get(Calendar.MONTH);
myDay = c.get(Calendar.DAY_OF_MONTH);
DatePickerDialog DatePicker = new DatePickerDialog(this, myCallBack, myYear, myMonth, myDay);
return DatePicker;
4

1 回答 1

1

您可以将DatePickerDialog设置按钮文本更改为:

DatePickerDialog datePicker = new DatePickerDialog(this, myCallBack, myYear, myMonth, myDay);
datePicker.setButton(DatePickerDialog.BUTTON_POSITIVE, "Enter text here", datePicker);
于 2012-10-11T09:15:56.233 回答