获取UIWebView的内容高度

本文转载至 http://i.cnblogs.com/EditPosts.aspx?opt=1

 
  1. #pragma mark - UIWebview delegete  
  2.   
  3. - (void)webViewDidFinishLoad:(UIWebView *)webView  
  4. {  
  5.     CGFloat height = [[webView stringByEvaluatingJavaScriptFromString:@"document.body.offsetHeight"] floatValue];  
  6.     CGRect frame = webView.frame;  
  7.     webView.frame = CGRectMake(frame.origin.x, frame.origin.y, frame.size.width, height);  
  8. }  
http://blog.csdn.net/aluoshuai/article/details/7708879
 
原文地址:https://www.cnblogs.com/Camier-myNiuer/p/4447917.html