Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed month and date views layout after changing size via split view #1307

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions FSCalendar/FSCalendar.m
Original file line number Diff line number Diff line change
Expand Up @@ -1506,8 +1506,12 @@ - (void)invalidateViewFrames
_preferredWeekdayHeight = FSCalendarAutomaticDimension;
_preferredRowHeight = FSCalendarAutomaticDimension;

[self.collectionViewLayout invalidateLayout];

[self setNeedsLayout];
[self layoutIfNeeded];

[self adjustMonthPosition];
}

// The best way to detect orientation
Expand Down
5 changes: 5 additions & 0 deletions FSCalendar/FSCalendarHeaderView.m
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,11 @@ - (void)prepareLayout

}

- (BOOL)shouldInvalidateLayoutForBoundsChange:(CGRect)newBounds
{
return self.collectionView ? !CGRectEqualToRect(self.collectionView.bounds, newBounds) : false;
DmytroStarchenko marked this conversation as resolved.
Show resolved Hide resolved
}

- (void)didReceiveOrientationChangeNotification:(NSNotification *)notificatino
{
[self invalidateLayout];
Expand Down