datetimepicker一個不錯的日曆效,選中和選擇日曆效果都很不錯,
實用的時候直接能夠把datetimepicker-library這個引入到項目,調用的地方在實現
TimePickerDialog.OnTimeSetListener接口。
大致實現由DatePickerDialog類來封裝,調用以下
DatePickerDialog datePickerDialog = DatePickerDialog.newInstance(this, calendar.get(Calendar.YEAR),
calendar.get(Calendar.MONTH), calendar.get(Calendar.DAY_OF_MONTH), isVibrate());html
datePickerDialog.setVibrate(isVibrate());
datePickerDialog.setYearRange(1985, 2028);
datePickerDialog.setCloseOnSingleTapDay(isCloseOnSingleTapDay());
datePickerDialog.show(getSupportFragmentManager(), DATEPICKER_TAG);
this
效果源碼:http://www.itlanbao.com/code/20151207/10000/100677.htmlspa