Material CalendarView:我想显示从月份的第一个日期开始的每个月,而不是显示上个月或下个月的日期的日历
private void setStartDate() {
calendar = LocalDate.now();
// calendarView.setSelectedDate(calendar);
calendarView.getCurrentDate();
Calendar c = Calendar.getInstance();
Log.e("----", Calendar.DATE + "");
c.set(Calendar.DAY_OF_MONTH, c.getActualMinimum(Calendar.DAY_OF_MONTH));
calendarView.state().edit()
.setMinimumDate(c)
.commit();
}
答案 0 :(得分:1)
<com.prolificinteractive.materialcalendarview.MaterialCalendarView
android:id="@+id/smallView"
android:layout_width="@dimen/calendar_size_small"
android:layout_height="@dimen/calendar_size_small"
app:mcv_showOtherDates="all"
/>
只需从xml视图中删除app:mcv_showOtherDates="all"
行