重庆迈尖科技有限公司
2019-01-30 94217b294ccd75a34787eb04d6e273e99536e45b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
//
//  AboutOurViewController.m
//  PapayaPlayerDaqo
//
//  Created by weikou on 15/8/4.
//  Copyright (c) 2015年 wgj. All rights reserved.
//
 
#import "SettingWebView.h"
 
@interface SettingWebView ()
 
@end
 
@implementation SettingWebView
 
- (void)viewDidLoad {
    [super viewDidLoad];
    self.title = _webTitle;
    
    UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
    [button setImage:[[UIImage imageNamed:@"详情页面返回"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal] forState:UIControlStateNormal];
    [button addTarget:self action:@selector(back:)
     forControlEvents:UIControlEventTouchUpInside];
    button.frame = CGRectMake(0, 0, 32, 32);
    UIBarButtonItem *iconBarItem=[[UIBarButtonItem alloc] initWithCustomView:button];
    self.navigationItem.leftBarButtonItem = iconBarItem;
    //设置使用模态跳转的返回按钮
    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];
    // Dispose of any resources that can be recreated.
}
 
-(void)back:(id)sender{
    [self.navigationController popViewControllerAnimated:YES];
}
 
/*
#pragma mark - Navigation
 
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/
 
@end