diff --git a/FSCalendar/FSCalendar.m b/FSCalendar/FSCalendar.m index d4b6ec4..0de3ef0 100644 --- a/FSCalendar/FSCalendar.m +++ b/FSCalendar/FSCalendar.m @@ -650,7 +650,7 @@ _needsAdjustingMonthPosition = YES; _needsAdjustingTextSize = YES; [_collectionViewLayout invalidateLayout]; // Necessary in Swift. Anyone can tell why? - + [_stickyHeaderMapTable.dictionaryRepresentation.allValues setValue:@YES forKey:@"needsAdjustingFrames"]; _preferedWeekdayHeight = FSCalendarAutomaticDimension; _preferedRowHeight = FSCalendarAutomaticDimension; _preferedHeaderHeight = FSCalendarAutomaticDimension; diff --git a/FSCalendar/FSCalendarCollectionView.m b/FSCalendar/FSCalendarCollectionView.m index c309a5a..7d79462 100644 --- a/FSCalendar/FSCalendarCollectionView.m +++ b/FSCalendar/FSCalendarCollectionView.m @@ -12,6 +12,16 @@ @synthesize scrollsToTop = _scrollsToTop, contentInset = _contentInset; +- (instancetype)initWithFrame:(CGRect)frame collectionViewLayout:(UICollectionViewLayout *)layout +{ + self = [super initWithFrame:frame collectionViewLayout:layout]; + if (self) { + self.scrollsToTop = NO; + self.contentInset = UIEdgeInsetsZero; + } + return self; +} + - (instancetype)initWithFrame:(CGRect)frame { self = [super initWithFrame:frame];