禁止WebView的弹跳和滚动:
[(UIScrollView *)[[webView subviews] objectAtIndex:0] setBounces:NO];
[(UIScrollView *)[[webView subviews] objectAtIndex:0] setScrollEnabled:NO];
设置UIWebView的背景颜色为透明
[_webView setBackgroundColor:[UIColor clearColor]];
[_webView setOpaque:NO];
- (void)webViewDidFinishLoad:(UIWebView *)webView {
NSString *title = [webView stringByEvaluatingJavaScriptFromString:@"document.title"];//获取当前页面的title
NSString *currentURL = webView.request.URL.absoluteString;
NSLog(@"title-%@--url-%@--",title,currentURL);
NSString *lJs = @"document.documentElement.innerHTML";//获取当前网页的html
self.currentHTML = [webView stringByEvaluatingJavaScriptFromString:lJs];
}