| | |
| | | button.frame = CGRectMake(0, 0, 32, 32); |
| | | UIBarButtonItem *iconBarItem=[[UIBarButtonItem alloc] initWithCustomView:button]; |
| | | self.navigationItem.leftBarButtonItem = iconBarItem; |
| | | |
| | | UIWebView *webView = [[UIWebView alloc] initWithFrame:CGRectMake(0, 0, KScreenW, KScreenH)]; |
| | | //设置使用模态跳转的返回按钮 |
| | | if(_ispresent){ |
| | | //隐藏状态栏 |
| | | [[UIApplication sharedApplication] setStatusBarHidden:YES]; |
| | | //添加返回按钮 |
| | | CGFloat height = 15; |
| | | if (KIsiPhoneX) { |
| | | height = 35; |
| | | } |
| | | UIButton *backButton=[[UIButton alloc] initWithFrame:CGRectMake(15, height, 32, 32)]; |
| | | [backButton setImage:[UIImage imageNamed:@"取消登录"] forState:UIControlStateNormal]; |
| | | [backButton addTarget:self action:@selector(presentBack) forControlEvents:UIControlEventTouchUpInside]; |
| | | [self.view addSubview:backButton]; |
| | | } |
| | | CGFloat height = 64; |
| | | if (KIsiPhoneX) { |
| | | height = 84; |
| | | } |
| | | UIWebView *webView = [[UIWebView alloc] initWithFrame:CGRectMake(0, height, KScreenW, KScreenH - height)]; |
| | | NSURLRequest *request =[NSURLRequest requestWithURL:[NSURL URLWithString:_requestURL]]; |
| | | [self.view addSubview: webView]; |
| | | [webView loadRequest:request]; |
| | | |
| | | // Do any additional setup after loading the view from its nib. |
| | | } |
| | | -(void)presentBack{ |
| | | [self dismissViewControllerAnimated:YES completion:^{ |
| | | //状态栏重现 |
| | | [[UIApplication sharedApplication] setStatusBarHidden:NO]; |
| | | }]; |
| | | } |
| | | |
| | | - (void)didReceiveMemoryWarning { |
| | | [super didReceiveMemoryWarning]; |