I am using tapku calendar in my project. I need to make an option for the user to start week on Sunday or on Monday. There is a method in viewDidLoad:

(id)initWithSunday:(BOOL)sundayFirst

Is there a way to update the calendar with new option? I tried calling initWithSunday with new value and [calendar reload], but errors occurred.

有帮助吗?

解决方案

Figured it out. The calendar subview must be removed from superview, set to nil, and added again.

[calendar removeFromSuperview]; 
calendar= nil; 

calendar =  [[TKCalendarMonthView alloc] initWithSundayAsFirst:startWhithSunday];
calendar.delegate = self;
calendar.dataSource = self;
calendar.frame = CGRectMake(14, 11, calendar.frame.size.width, calendar.frame.size.height);
[self.view addSubview:calendar];
[calendar reload];
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top