Open adsyak opened 11 years ago
Add the new property to the header // TKCalendarDayEventView.h typedef enum { // add more colors what you need TKCalendarEventColorBlue // Default } TKCalendarEventColor;
/* This is the color type of the event. / @property (nonatomic) TKCalendarEventColor colorType;
And a new method to set it's color to // TKCalendarDayEventView.m
(void)setColorType:(TKCalendarEventColor)type{ float alpha = 1;// 0.8; unsigned int backgrounHexColor; unsigned int borderHexColor; unsigned int textHexColor;
switch (type) { case TKCalendarEventColorBlue: default: textHexColor = 0x194fa5; backgrounHexColor = 0x7ca6ec; borderHexColor = 0x6591db; break; }
self.titleLabel.textColor = [UIColor colorWithHex:textHexColor]; self.locationLabel.textColor = [UIColor colorWithHex:textHexColor]; self.backgroundColor = self.titleLabel.backgroundColor = self.locationLabel.backgroundColor = [UIColor colorWithHex:backgrounHexColor alpha:alpha]; self.layer.borderColor = [UIColor colorWithHex:borderHexColor alpha:alpha].CGColor; _colorType = type; }
Pick an online color tool to make similar colors nice: http://mashable.com/2013/01/15/color-scheme-tools/
Fleshman, thanks for your reply. do you use a specific version ? TKCalendarEventColor is unknow type. Regards
I use a heavily customized older version, and updated my last comment because i forgot that TKCalendarEventColor enum last time :)
Thanks Fleshman :-)
Hi, It would be nice to be able to specify a custom color for each TKCalendarDayEventView. In IOS Calendar each kind of events (Private, work etc..) has its own color. Would be nice to have the same thing here. Regards