안녕하세요 안드로이드 초보자입니다
material calendarview를 사용하려는데 캘린더제목이 4월 2020년형식이라
setTitleFormatter()를 이용해서 2020년 4월로 바꾸고싶은데요
final Calendar date = Calendar.getInstance();
calendar_view.setTitleFormatter(new TitleFormatter() {
@Override
public CharSequence format(CalendarDay day) {
SimpleDateFormat calendar_view_format = new SimpleDateFormat("yyyy MM");
String monthAndYear = calendar_view_format.format(date.getTime());
return monthAndYear;
}
});
이렇게 바꿨는데 달력을 넘기면 달력자체는 바뀌는데 제목은 계속 2020년 04월만 뜹니다
설명에는
Header
You can customize the label displayed in the header by setting a custom TitleFormatter by calling setTitleFormatter(). The formatter's format() method will be called with a CalendarDay containing the month and year you should format. The default implementation uses a SimpleDateFormat with a format of "MMMM yyyy". The library provides a DateFormatTitleFormatter and MonthArrayTitleFormatter for convenience.
You can also set a string array resource with mcv_monthLabels that will use the MonthArrayTitleFormatter to format the title with the months provided.
출처:https://github.com/prolificinteractive/material-calendarview/wiki/Customization#topbar-options
이렇게 써져있는데 이해가 안되네요 도와주시면 정말 감사하겠습니다