获取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

 

 
posted @ 2015-04-22 16:38  天牛  阅读(193)  评论(0编辑  收藏  举报