From db5ee02777068242888b7afbe10c46e6312075f0 Mon Sep 17 00:00:00 2001 From: coderyi Date: Sun, 22 Oct 2017 11:21:58 +0800 Subject: [PATCH] =?UTF-8?q?[add]iphonex=E9=80=82=E9=85=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../LoginModule/LoginWebViewController.m | 25 ++++++------------- 1 file changed, 7 insertions(+), 18 deletions(-) diff --git a/Monkey/Classes/Module/PersonalModule/LoginModule/LoginWebViewController.m b/Monkey/Classes/Module/PersonalModule/LoginModule/LoginWebViewController.m index 75370a9..38230da 100755 --- a/Monkey/Classes/Module/PersonalModule/LoginModule/LoginWebViewController.m +++ b/Monkey/Classes/Module/PersonalModule/LoginModule/LoginWebViewController.m @@ -28,35 +28,24 @@ - (void)viewDidLoad } self.hidesBottomBarWhenPushed = YES; - titleText = [[UILabel alloc] initWithFrame: CGRectMake((ScreenWidth-120)/2, 0, 120, 44)]; + UIView *bar=[[UIView alloc] initWithFrame:CGRectMake(0, 0, ScreenWidth, 64+(IsiPhoneX ? 24 : 0))]; + [self.view addSubview:bar]; + bar.backgroundColor=YiBlue; + + titleText = [[UILabel alloc] initWithFrame: CGRectMake((ScreenWidth-120)/2, 20+(IsiPhoneX ? 24 : 0), 120, 44)]; titleText.backgroundColor = [UIColor clearColor]; titleText.textColor=[UIColor whiteColor]; [titleText setFont:[UIFont systemFontOfSize:19.0]]; titleText.textAlignment=NSTextAlignmentCenter; - self.navigationItem.titleView=titleText; titleText.text=_urlString; - - UINavigationBar *bar=[[UINavigationBar alloc] initWithFrame:CGRectMake(0, 0, ScreenWidth, 64)]; - UIView *iPhoneXAdaptView; - if (IsiPhoneX) { - iPhoneXAdaptView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, ScreenWidth, 88)]; - [self.view addSubview:iPhoneXAdaptView]; - iPhoneXAdaptView.backgroundColor = YiBlue; - } else { - [self.view addSubview:bar]; - bar.barTintColor=YiBlue; - } + [bar addSubview:titleText]; backBt=[UIButton buttonWithType:UIButtonTypeCustom]; backBt.frame=CGRectMake(10, 27 + (IsiPhoneX ? 24 : 0), 30, 30); [backBt setImage:[UIImage imageNamed:@"ic_arrow_back_white_48pt"] forState:UIControlStateNormal]; [backBt setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; [backBt addTarget:self action:@selector(backBtAction) forControlEvents:UIControlEventTouchUpInside]; - if (IsiPhoneX) { - [iPhoneXAdaptView addSubview:backBt]; - } else { - [bar addSubview:backBt]; - } + [bar addSubview:backBt]; backBt.hidden=YES; UIWebView *webView=[[UIWebView alloc] initWithFrame:CGRectMake(0, 64 + (IsiPhoneX ? 24 : 0), ScreenWidth, ScreenHeight-64-(IsiPhoneX ? 24 : 0))];