美文网首页
FSCalendar使用

FSCalendar使用

作者: manmangood | 来源:发表于2020-03-11 17:47 被阅读0次

1、开发中遇到bug 2020年8月,月和周切换,月的高度计算不正确
修改FSCalendarTransitionCoordinator中boundingRectForScope方法

- (CGRect)boundingRectForScope:(FSCalendarScope)scope page:(NSDate *)page
{
    CGSize contentSize;
    switch (scope) {
        case FSCalendarScopeMonth: {
            [self.calendar fs_setVariable:page forKey:@"_currentPage"];
            contentSize = self.calendar.adjustsBoundingRectWhenChangingMonths ? [self.calendar sizeThatFits:self.calendar.frame.size scope:scope] : self.cachedMonthSize;
            break;
        }
        case FSCalendarScopeWeek: {
            contentSize = [self.calendar sizeThatFits:self.calendar.frame.size scope:scope];
            break;
        }
    }
    return (CGRect){CGPointZero, contentSize};
}

相关文章

网友评论

      本文标题:FSCalendar使用

      本文链接:https://www.haomeiwen.com/subject/xmqfchtx.html