initWithFrame:collectionViewLayout should also be intercepted

1. initWithFrame:collectionViewLayout should also be overriden
2. Reset stickyHeaders after orientation changing
This commit is contained in:
dingwenchao 2015-11-04 17:28:37 +08:00
parent fad2baf155
commit 28a09164a6
2 changed files with 11 additions and 1 deletions

View File

@ -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;

View File

@ -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];