further fix iPhone settings menu safe area issue
This commit is contained in:
1 parent
338523e216
commit
c2d3028668
1 file changed
+9
-5
@@ -379,12 +379,13 @@ BOOL isCustomResolution(int resolutionSelected) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
UIDeviceOrientation orientation = [UIDevice currentDevice].orientation;
|
UIWindow *keyWindow = [UIApplication sharedApplication].windows.firstObject;
|
||||||
|
|
||||||
|
if (@available(iOS 13.0, *)) {
|
||||||
if(parentStackWidthConstraint && parentStackLeadingConstraint) [NSLayoutConstraint deactivateConstraints:@[parentStackLeadingConstraint, parentStackWidthConstraint]];
|
if(parentStackWidthConstraint && parentStackLeadingConstraint) [NSLayoutConstraint deactivateConstraints:@[parentStackLeadingConstraint, parentStackWidthConstraint]];
|
||||||
|
UIInterfaceOrientation currentOrientation = keyWindow.windowScene.interfaceOrientation;
|
||||||
switch (orientation) {
|
switch (currentOrientation) {
|
||||||
case UIDeviceOrientationLandscapeLeft:
|
case UIInterfaceOrientationLandscapeRight:
|
||||||
parentStackLeadingConstraint = [_parentStack.leadingAnchor constraintEqualToAnchor:self.view.safeAreaLayoutGuide.leadingAnchor constant:0];
|
parentStackLeadingConstraint = [_parentStack.leadingAnchor constraintEqualToAnchor:self.view.safeAreaLayoutGuide.leadingAnchor constant:0];
|
||||||
parentStackWidthConstraint = [_parentStack.widthAnchor constraintEqualToAnchor:self.view.safeAreaLayoutGuide.widthAnchor constant:-10];
|
parentStackWidthConstraint = [_parentStack.widthAnchor constraintEqualToAnchor:self.view.safeAreaLayoutGuide.widthAnchor constant:-10];
|
||||||
break;
|
break;
|
||||||
@@ -393,8 +394,11 @@ BOOL isCustomResolution(int resolutionSelected) {
|
|||||||
parentStackWidthConstraint = [_parentStack.widthAnchor constraintEqualToAnchor:self.view.widthAnchor constant:-20];
|
parentStackWidthConstraint = [_parentStack.widthAnchor constraintEqualToAnchor:self.view.widthAnchor constant:-20];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
[NSLayoutConstraint activateConstraints:@[parentStackLeadingConstraint, parentStackWidthConstraint]];
|
[NSLayoutConstraint activateConstraints:@[parentStackLeadingConstraint, parentStackWidthConstraint]];
|
||||||
|
} else {
|
||||||
|
// Fallback on earlier versions
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
double delayInSeconds = 0.05;
|
double delayInSeconds = 0.05;
|
||||||
dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, (int64_t)(delayInSeconds * NSEC_PER_SEC));
|
dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, (int64_t)(delayInSeconds * NSEC_PER_SEC));
|
||||||
|
|||||||
Reference in new issue
Block a user