1

我正在为我的应用程序使用FSCalendar。谁能告诉我如何为选定的事件设置不同的点颜色?

4

1 回答 1

1

您必须设置日历的数据源和委托

calendar.dataSource = self;
calendar.delegate = self;

- (NSInteger)calendar:(FSCalendar *)calendar numberOfEventsForDate:(NSDate *)date 
{
    return 4;// Return how many dot to show below date
}


- (NSArray *)calendar:(FSCalendar *)calendar appearance:(FSCalendarAppearance *)appearance eventColorsForDate:(NSDate *)date
{

    return @[[UIColor magentaColor],appearance.eventColor,[UIColor blackColor],appearance.eventColor];

}
于 2016-12-07T10:51:04.957 回答