I am using tapku library for displaying calender in my application. I have done all date calculations and marked the cells properly acccording to my need but I want to give a different color to the cell according to my choice. I have done marking in single background color but I want to display in three colors. How can I?
Share
Look at the method:
The color is set to [UIColor grayColor] in the drawRect: method (one below in the code). What you can do is check if the date is a date you’re interested in and then change the color appropriately. I’m not sure how you want to differentiate between your dates–it’s your call; in the past, I’ve changed the parameter of the mark argument to something like an int and then basing the color on the int’s value. The mark argument comes from the marks array, so if you pass in an array with different values and then change the method arguments throughout the TKCalendarMonthView, it should be okay.
For example, lets say you want: mark = 1 –> draw red; mark = 2 –> draw green; mark > 2 –> draw blue.
Hope this answers your question.