- (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
最新推荐文章于 2021-07-17 09:08:42 发布