mirror of
https://github.com/moonlight-stream/moonlight-ios.git
synced 2026-02-16 10:31:02 +00:00
Fix content insets for host and app scroll views
This commit is contained in:
@@ -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];
|
||||
|
||||
Reference in New Issue
Block a user