From 3aff39059f06dfc2992f705c9d1bb1cc6b908597 Mon Sep 17 00:00:00 2001 From: xuemh Date: Thu, 15 Mar 2018 22:54:45 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90iPhoneX=E9=80=82=E9=85=8D=E3=80=91?= =?UTF-8?q?=E9=A6=96=E9=A1=B5=E5=AF=BC=E8=88=AA=E6=A0=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Ifish/Utinitys/IfishUtils/UINavigationBar+Background.m | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Ifish/Utinitys/IfishUtils/UINavigationBar+Background.m b/Ifish/Utinitys/IfishUtils/UINavigationBar+Background.m index bb1848d..e968ad8 100755 --- a/Ifish/Utinitys/IfishUtils/UINavigationBar+Background.m +++ b/Ifish/Utinitys/IfishUtils/UINavigationBar+Background.m @@ -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];