FSCalendar使用实践

2023-02-25 15:08:06 浏览数 (1)

用过JTCalendar,没有农历显示,然后就换成了FSCalendar,上代码 @property (strong, nonatomic) FSCalendar *calendar;

(FSCalendar *)calendar { if (_calendar == nil) {

代码语言:javascript复制
  _calendar = [[FSCalendar alloc] initWithFrame:CGRectMake(0, 0, SCREEN_W, 280)];
  _calendar.dataSource = self;
  _calendar.delegate = self;
  _calendar.allowsMultipleSelection = NO;
  _calendar.scrollEnabled = NO;
  _calendar.appearance.headerDateFormat = @"M月";
  _calendar.appearance.selectionColor = Color_Red;
  _calendar.appearance.headerTitleColor = [UIColor blackColor];
  _calendar.appearance.headerMinimumDissolvedAlpha = 0;
  _calendar.appearance.caseOptions = FSCalendarCaseOptionsHeaderUsesUpperCase;
  // 设置周字体颜色
  _calendar.appearance.weekdayTextColor = [UIColor lightGrayColor];
  _calendar.placeholderType = FSCalendarPlaceholderTypeNone;
  _calendar.appearance.todayColor = [UIColor whiteColor];
  [_calendar selectDate:[NSDate date] scrollToDate:YES];

} return _calendar; } 如果你用到了事件需要显示小点的话你要记得刷新数据[self.calendar reloadData];

0 人点赞