Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

sealedace/WebViewProgressView

Open more actions menu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

WebViewProgressView

WebView进度条

How To Use

  • UIWebView模式:
// 创建进度条代理,用于处理进度控制
_progressProxy = [[YHWebViewProgress alloc] init];

// 创建进度条
YHWebViewProgressView *progressView = [[YHWebViewProgressView alloc] initWithFrame:CGRectMake(0, CGRectGetMaxY(self.navigationController.navigationBar.frame), CGRectGetWidth(self.view.bounds), 4)];
progressView.autoresizingMask = UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleBottomMargin;

// 设置进度条
self.progressProxy.progressView = progressView;
// 将UIWebView代理指向YHWebViewProgress
self.webView.delegate = self.progressProxy;
// 设置webview代理转发到self(可选)
self.progressProxy.webViewProxy = self;

// 添加到视图
[self.view addSubview:progressView];
  • WKWebView模式:
// 创建进度条
YHWebViewProgressView *progressView = [[YHWebViewProgressView alloc] initWithFrame:CGRectMake(0, CGRectGetMaxY(self.navigationController.navigationBar.frame), CGRectGetWidth(self.view.bounds), 4)];
progressView.autoresizingMask = UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleBottomMargin;
// 指定WKWebView对象来监听进度
[progressView useWkWebView:self.webView];

About

WebView进度条Demo

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
Morty Proxy This is a proxified and sanitized view of the page, visit original site.