문제

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