【iPhoneX适配】首页导航栏
This commit is contained in:
parent
46bf2c8cc1
commit
3aff39059f
|
|
@ -26,6 +26,11 @@ static char overlayKey;
|
|||
if (!self.overlay) {
|
||||
[self setBackgroundImage:[UIImage new] forBarMetrics:UIBarMetricsDefault];
|
||||
self.overlay = [[UIView alloc] initWithFrame:CGRectMake(0, -20, [UIScreen mainScreen].bounds.size.width, CGRectGetHeight(self.bounds) + 20)];
|
||||
if (@available(iOS 11.0, *)) {
|
||||
self.overlay = [[UIView alloc] initWithFrame:CGRectMake(0, -44, [UIScreen mainScreen].bounds.size.width, CGRectGetHeight(self.bounds) + 44)];
|
||||
} else {
|
||||
self.overlay = [[UIView alloc] initWithFrame:CGRectMake(0, -20, [UIScreen mainScreen].bounds.size.width, CGRectGetHeight(self.bounds) + 20)];
|
||||
}
|
||||
self.overlay.userInteractionEnabled = NO;
|
||||
self.overlay.autoresizingMask = UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight;
|
||||
[self insertSubview:self.overlay atIndex:0];
|
||||
|
|
|
|||
Loading…
Reference in New Issue