Skip to content

Commit

Permalink
collectionViewDay working fine in landscape mode
Browse files Browse the repository at this point in the history
  • Loading branch information
fggeraissate committed May 30, 2014
1 parent 0405100 commit e8f63da
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
Binary file not shown.
4 changes: 2 additions & 2 deletions FFCalendar/FFCalendars/FFDayCalendarView/FFDayCalendarView.m
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ - (void)setDictEvents:(NSMutableDictionary *)_dictEvents {
- (void)invalidateLayout {
[collectionViewHeaderDay.collectionViewLayout invalidateLayout];
[dayContainerScroll.collectionViewDay.collectionViewLayout invalidateLayout];
[self updateHeader];
[self dateChanged:nil];
}

#pragma mark - FFDateManager Notification
Expand Down Expand Up @@ -152,7 +152,7 @@ - (void)showViewDetailsWithEvent:(FFEvent *)_event cell:(UICollectionViewCell *)
[viewDetail removeFromSuperview];
viewDetail = nil;

viewDetail = [[FFEventDetailView alloc] initWithFrame:CGRectMake(self.frame.size.width/2., HEADER_HEIGHT_SCROLL, self.frame.size.width/2., self.frame.size.height-HEADER_HEIGHT_SCROLL) event:_event];
viewDetail = [[FFEventDetailView alloc] initWithFrame:CGRectMake(self.frame.size.width/2., HEADER_HEIGHT_SCROLL, self.frame.size.width/2., self.frame.size.height-HEADER_HEIGHT_SCROLL) event:_event];
[viewDetail setAutoresizingMask:AR_WIDTH_HEIGHT | UIViewAutoresizingFlexibleLeftMargin];
[viewDetail setProtocol:self];
[self addSubview:viewDetail];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ - (id)initWithFrame:(CGRect)frame collectionViewLayout:(UICollectionViewLayout *
boolGoNext = NO;
boolGoPrevious = NO;

[self setAutoresizingMask:AR_WIDTH_HEIGHT];
[self setAutoresizingMask:UIViewAutoresizingFlexibleWidth];
}
return self;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,14 @@ - (void)setDictEvents:(NSMutableDictionary *)_dictEvents {

FFViewWithHourLines *viewWithHourLines = [[FFViewWithHourLines alloc] initWithFrame:CGRectZero];

collectionViewDay = [[FFDayCollectionView alloc] initWithFrame:CGRectMake(10.,0.,self.frame.size.width-10,viewWithHourLines.totalHeight)collectionViewLayout:[UICollectionViewFlowLayout new]];
collectionViewDay = [[FFDayCollectionView alloc] initWithFrame:CGRectMake(10.,0.,self.frame.size.width-10,viewWithHourLines.totalHeight+HEIGHT_CELL_HOUR)collectionViewLayout:[UICollectionViewFlowLayout new]];
[collectionViewDay scrollToItemAtIndexPath:[NSIndexPath indexPathForItem:[NSDate componentsOfDate:[[FFDateManager sharedManager] currentDate]].day-1+7 inSection:0] atScrollPosition:UICollectionViewScrollPositionLeft animated:NO];
[self addSubview:collectionViewDay];

labelWithActualHour = [viewWithHourLines labelWithCurrentHourWithWidth:self.frame.size.width];
[labelWithActualHour setFrame:CGRectMake(labelWithActualHour.frame.origin.x, labelWithActualHour.frame.origin.y+viewWithHourLines.frame.origin.y, labelWithActualHour.frame.size.width, labelWithActualHour.frame.size.height)];

[self setContentSize:CGSizeMake(self.frame.size.width, collectionViewDay.frame.origin.y+collectionViewDay.frame.size.height)];
[self setContentSize:CGSizeMake(self.frame.size.width, collectionViewDay.frame.origin.y+collectionViewDay.frame.size.height-HEIGHT_CELL_HOUR)];
[self scrollRectToVisible:CGRectMake(0, labelWithActualHour.frame.origin.y, self.frame.size.width, self.frame.size.height) animated:NO];
}

Expand Down

0 comments on commit e8f63da

Please sign in to comment.