Skip to content

Commit

Permalink
update Example
Browse files Browse the repository at this point in the history
  • Loading branch information
CoderZhuXH committed Nov 18, 2017
1 parent 2c3aadb commit f204304
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions XHLaunchAdExample/Class/WebViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ - (void)viewDidLoad {
self.automaticallyAdjustsScrollViewInsets = NO;
self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"" style:UIBarButtonItemStylePlain target:self action:@selector(back)];

self.webView = [[WKWebView alloc] initWithFrame:CGRectMake(0, 64, self.view.bounds.size.width, self.view.bounds.size.height-64)];
CGFloat navbarHeight = [UIApplication sharedApplication].statusBarFrame.size.height + 44;
self.webView = [[WKWebView alloc] initWithFrame:CGRectMake(0, navbarHeight, self.view.bounds.size.width, self.view.bounds.size.height-navbarHeight)];
self.webView.scrollView.backgroundColor = [UIColor groupTableViewBackgroundColor];
[self.view addSubview:self.webView];

Expand All @@ -57,7 +58,7 @@ - (void)viewDidLoad {
NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:(self.URLString)]];
[self.webView loadRequest:request];

self.progressView = [[UIProgressView alloc] initWithFrame:CGRectMake(0, 62, self.view.bounds.size.width, 2)];
self.progressView = [[UIProgressView alloc] initWithFrame:CGRectMake(0, navbarHeight-2, self.view.bounds.size.width, 2)];
self.progressView.progressViewStyle = UIProgressViewStyleBar;
self.progressView.progressTintColor = [UIColor blackColor];
[self.navigationController.view addSubview:self.progressView];
Expand Down

0 comments on commit f204304

Please sign in to comment.