码迷,mamicode.com
首页 > Web开发 > 详细

UIWebView获得内容的高-作出自适应高的UIWebView

时间:2015-06-16 16:14:58      阅读:148      评论:0      收藏:0      [点我收藏+]

标签:

http://blog.csdn.net/matrixhero/article/details/8443972

- (void)webViewDidFinishLoad:(UIWebView *)webView
{
NSString *height_str= [webView stringByEvaluatingJavaScriptFromString: @"document.body.offsetHeight"];
int height = [height_str intValue];
webView.frame = CGRectMake(0,0,320,height);
NSLog(@"height: %@", [webView stringByEvaluatingJavaScriptFromString: @"document.body.offsetHeight"]);
}

UIWebView获得内容的高-作出自适应高的UIWebView

标签:

原文地址:http://www.cnblogs.com/Keys/p/4580672.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!