Don't apply the about screen inset on button-less iPads

This commit is contained in:
Lior Halphon 2023-01-29 01:45:17 +02:00
parent 8755e505d5
commit 9972ce999d
1 changed files with 9 additions and 7 deletions

View File

@ -215,13 +215,15 @@
- (void)viewDidLayoutSubviews - (void)viewDidLayoutSubviews
{ {
[super viewDidLayoutSubviews]; [super viewDidLayoutSubviews];
UIEdgeInsets insets = self.view.window.safeAreaInsets; if ([UIDevice currentDevice].userInterfaceIdiom != UIUserInterfaceIdiomPad) {
UIView *view = ((UIVisualEffectView *)self.view).contentView; UIEdgeInsets insets = self.view.window.safeAreaInsets;
CGRect parentFrame = self.view.frame; UIView *view = ((UIVisualEffectView *)self.view).contentView;
view.frame = CGRectMake(insets.left, CGRect parentFrame = self.view.frame;
0, view.frame = CGRectMake(insets.left,
parentFrame.size.width - insets.left - insets.right, 0,
parentFrame.size.height - insets.bottom); parentFrame.size.width - insets.left - insets.right,
parentFrame.size.height - insets.bottom);
}
if (self.view.frame.size.width > self.view.frame.size.height) { if (self.view.frame.size.width > self.view.frame.size.height) {
[self layoutForHorizontalLayout]; [self layoutForHorizontalLayout];
} }