FSCalendar
FSCalendar copied to clipboard
When scope toggle, wrong height delegate in boundingRectWillChange
I swiped to this month, August which has extra height and boundingRectWillChange return correct height
After changed scope to week and back to month, it returned wrong one
PS: seems like it always happen when I choose day in first row.
这个问题,你解决了吗?我这边的也遇到了同样问题
@waiphyo-0gravity 那个问题你解决了吗
same problem! help @WenchaoD
same problem! help @WenchaoD
在FSCalendar文件.h中的currentPage下面增加一个新的属性@property (strong, nonatomic) NSDate *use_currentPage;然后再.m文件的方法- (CGSize)sizeThatFits:(CGSize)size scope:(FSCalendarScope)scope { CGFloat headerHeight = self.preferredHeaderHeight; CGFloat weekdayHeight = self.preferredWeekdayHeight; CGFloat rowHeight = self.rowHeight > 0 ? self.rowHeight : self.preferredRowHeight; CGFloat paddings = self.collectionViewLayout.sectionInsets.top + self.collectionViewLayout.sectionInsets.bottom;
if (!self.floatingMode) {
switch (scope) {
case FSCalendarScopeMonth: {
CGFloat height = weekdayHeight + headerHeight + [self.calculator numberOfRowsInMonth:_use_currentPage]*rowHeight + paddings;
return CGSizeMake(size.width, height);
}
case FSCalendarScopeWeek: {
CGFloat height = weekdayHeight + headerHeight + rowHeight + paddings;
return CGSizeMake(size.width, height);
}
}
} else {
return CGSizeMake(size.width, self.fs_height);
}
return size;
}进行换成你的那个即可,外面使用的时候赋值use_currentPage值就能解决这个问题