UIWebView自适应高度

2015-01-14 0 581
UIWebView自适应高度
//webview自适应高度     delegate里面实现

- (void)webViewDidFinishLoad:(UIWebView *)webView

{

    NSString *height_str= [webViewstringByEvaluatingJavaScriptFromString: @"document.body.offsetHeight"];

    heightCell = [height_str intValue];

    webView.frame = CGRectMake(0,0,320,heightCell);

    NSLog(@"height: %@", [webViewstringByEvaluatingJavaScriptFromString: @"document.body.offsetHeight"]);

}  


//禁止web滑动

 jobRequestWeb.scrollView.bounces = NO;

//取消web右边滑动条

 jobRequestWeb.scrollView.showsVerticalScrollIndicator = NO;

遇见资源网 objective-c UIWebView自适应高度 http://www.ox520.com/16068.html

常见问题

相关文章

发表评论
暂无评论
官方客服团队

为您解决烦忧 - 24小时在线 专业服务