Calendar Month Presenter event color

2 posts, 0 answers
  1. Cico
    Cico avatar
    3 posts
    Member since:
    Dec 2015

    Posted 15 Feb Link to this post

         Hi,

     how to change textcolor or events in Month Presenter view? Background color is set using TKCalendarEvent.eventColor, but Text Color is always black.

     

    Thank you

     

  2. Sophi
    Admin
    Sophi avatar
    99 posts

    Posted 18 Feb Link to this post

    Hi Cico,

    You are able to apply specific event color for every cell depending on it's state.
    Conform to the TKCalendarDelegate protocol and implement the calendar:updateVisualsForCell: method which provides you with every cell instance used in the calendar, this way you can customize the cells entirely.
    You should use the eventTextColor or allDayEventTextColor properties of the cell's style.
    Consider the following code snippet.
    - (void)calendar:(TKCalendar*)calendar updateVisualsForCell:(TKCalendarCell*)cell;
    {
        if ([cell isKindOfClass:[TKCalendarDayCell class]]) {
            ((TKCalendarDayCellStyle*)cell.style).eventTextColor= [UIColor greenColor];
            ((TKCalendarDayCellStyle*)cell.style).allDayEventTextColor = [UIColor purpleColor];
         }
    }

    I hope this helps you.

    Regards,
    Sophi
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. DevCraft banner
Back to Top