Fix scroll offset for iPhoneX now that content is behind toolbar

This commit is contained in:
Michael Kirk 2018-07-02 23:33:55 -06:00
parent 83d3f17d44
commit a27ee19f4e
1 changed files with 5 additions and 2 deletions

View File

@ -4262,8 +4262,11 @@ typedef enum : NSUInteger {
CGFloat contentHeight = self.safeContentHeight;
CGFloat dstY
= MAX(0, contentHeight + self.collectionView.contentInset.bottom - self.collectionView.bounds.size.height);
// bottomLayoutGuide accounts for extra offset needed on iPhoneX
CGFloat dstY = MAX(0,
contentHeight + self.collectionView.contentInset.bottom + self.bottomLayoutGuide.length
- self.collectionView.bounds.size.height);
[self.collectionView setContentOffset:CGPointMake(0, dstY) animated:NO];
[self didScrollToBottom];