This is a migrated thread and some comments may be shown as answers.

How to set selected date circle background

4 Answers 483 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
willem odendaal
Top achievements
Rank 1
willem odendaal asked on 06 Feb 2015, 11:06 AM
I would like to change the background color of the selected date's *circle*.

How do I do that?

I have tried setting a custom color like so, but this does not have any effect:
    dayCell.Style.DefaultSelectionColor = UIColor.Red;

4 Answers, 1 is accepted

Sort by
0
willem odendaal
Top achievements
Rank 1
answered on 06 Feb 2015, 11:21 AM
I found the solution. Not difficult, "Shape" is what needs to be modified:

    cell.Style.ShapeStroke = new TKStroke (UIColor.Red); 
    cell.Style.ShapeFill = new TKSolidFill (UIColor.Red);
0
Jack
Telerik team
answered on 06 Feb 2015, 05:09 PM
Hi Willen,

Thank you for contacting us. I am glad to hear that you have solved your issue. You can read more about TKCalendar and how to customize it in our online documentation. Do not hesitate to contact us id you have further questions.

Regards,
Jack
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
asdas
Top achievements
Rank 1
answered on 14 Oct 2015, 05:48 AM

Hi willem, 

even i am looking for something similar, but i am not able locate the cell of the selected date through this method. 

(void)calendar:(TKCalendar* __nonnull)calendar didSelectDate:(NSDate* __nonnull)date. 

could you please brief out how u achieved this. 

0
Jack
Telerik team
answered on 14 Oct 2015, 11:56 AM
Hi Asdas,

You can use the cellForDate method in TKCalendarMonthPresenter for this purpose. Consider the sample below:
TKCalendarMonthPresenter *presenter = (TKCalendarMonthPresenter*)self.calendarView.presenter;
TKCalendarDayCell *cell = [presenter cellForDate:date];

Please note that like in UITableView, TKCalendar uses UI virtualization. This means that cells are reused when navigating to a different month for example. So, the best way to manipulate cell appearance in TKCalendar is by implementing calendar:updateVisualsForCell: method of TKCalendarDelegate. You can find further information related with TKCalendar customization in our online documentation.

I hope this helps.

Regards,
Jack
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
Tags
Calendar
Asked by
willem odendaal
Top achievements
Rank 1
Answers by
willem odendaal
Top achievements
Rank 1
Jack
Telerik team
asdas
Top achievements
Rank 1
Share this question
or