我正在使用DSLCalendarView
來顯示計劃。當月份發生變化時,didChangeToVisibleMonth
被調用。我正在更新此事件的數據。但我也希望日曆在此事件中重新加載。 是否可以刷新/重新加載DSLCalendarView
?DSLCalendarView刷新
0
A
回答
1
在DSLCalendarView.m,您將添加標籤兩種觀點的價值。下面添加標籤值的代碼。只是在文件中改變。
- (id)initWithFrame:(CGRect)frame {
self = [super initWithFrame:frame];
if (self != nil) {
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(reloadCalendar:)
name:@"reloadCalendar"
object:nil];
[self commonInit];
}
return self;}
-(void)reloadCalendar{
[self commonInit];
}
- (void)commonInit {
[[self viewWithTag:508] removeFromSuperview];
[[self viewWithTag:509] removeFromSuperview];
self.monthSelectorView.tag=508;
self.monthContainerView.tag=509;
}
- (void)didTapMonthBack:(id)sender {
NSDateComponents *newMonth = self.visibleMonth;
newMonth.month--;
[self commonInit];
[self setVisibleMonth:newMonth animated:YES]; }
- (void)didTapMonthForward:(id)sender {
NSDateComponents *newMonth = self.visibleMonth;
newMonth.month++;
[self commonInit];
[self setVisibleMonth:newMonth animated:YES];}
如果我們將點擊前進或後退按鈕,在日曆後重新加載日曆。
在視圖控制器如果我們改變的話只是一個通知調用方法時間方法會調用事件調用。
- (void)calendarView:(DSLCalendarView *)calendarView didChangeToVisibleMonth:(NSDateComponents *)month {
[[NSNotificationCenter defaultCenter]postNotificationName:@"reloadCalendar" object:self];
NSLog(@"Now showing %@", month);
}
0
看見了圖書館不要有任何把戲做到這一點,遺憾的是不具有重載方法:(。可能有些變通解決問題,你的情況。
相關問題
- 1. DSLCalendarView - 禁用日期的全線顯示
- 2. DSLCalendarView數據處理和當前日期
- 3. 刷新刷新
- 4. 刷新/刷新UIView
- 5. 刷新刷新表
- 6. 刷新不刷新
- 7. 刷新VS刷新
- 8. iMacros - iFrame(刷新/刷新)
- 9. 刷新/刷新數據表
- 10. 在ViewPager上刷新刷新
- 11. 刷新面板javascript刷新
- 12. PFQueryCollectionView不會刷新刷新
- 13. 刷新圖像不刷新
- 14. IE刷新刷新閃存
- 15. 刷新/刷新按鈕刷新對象/數據在UIView
- 16. 如何在JTextPane中無刷新刷新(刷新)文本
- 17. 刷新
- 18. 刷新
- 19. PHP - 刷新頁面刷新記錄
- 20. 頁面刷新時刷新MySQL記錄
- 21. 刷新Gridview而不刷新整頁(ASP.Net)
- 22. 在python getstr()中刷新時刷新
- 23. 強制CascadingDropDown無刷新刷新
- 24. 當瀏覽器刷新localStorage刷新
- 25. 如何刷新刷新佈局android
- 26. 安卓拉刷新:如何刷新
- 27. 刷新內容不刷新頁面
- 28. 強制非阻塞刷新刷新
- 29. PHP窗體(刷新)到AJAX(不刷新)
- 30. 刷卡刷新以更新數據
工作就像一個魅力。謝謝。 – Nitish
你總是歡迎@Nitish –