Fix content insets for host and app scroll views
This commit is contained in:
parent
a40b30016b
commit
29dff2320b
1 changed files with 16 additions and 0 deletions
|
|
@ -677,6 +677,22 @@ static NSMutableSet* hostList;
|
|||
[_loadingFrame dismissLoadingFrame:completion];
|
||||
}
|
||||
|
||||
- (void)adjustScrollViewForSafeArea:(UIScrollView*)view {
|
||||
if (@available(iOS 11.0, *)) {
|
||||
if (self.view.safeAreaInsets.left >= 20 || self.view.safeAreaInsets.right >= 20) {
|
||||
view.contentInset = UIEdgeInsetsMake(0, 20, 0, 20);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Adjust the subviews for the safe area on the iPhone X.
|
||||
- (void)viewSafeAreaInsetsDidChange {
|
||||
[super viewSafeAreaInsetsDidChange];
|
||||
|
||||
[self adjustScrollViewForSafeArea:self.collectionView];
|
||||
[self adjustScrollViewForSafeArea:self->hostScrollView];
|
||||
}
|
||||
|
||||
- (void)viewDidLoad
|
||||
{
|
||||
[super viewDidLoad];
|
||||
|
|
|
|||
Loading…
Reference in a new issue