iOS 通过原生按钮,控制webView显示范围,达到折叠展开的
作者:
Happy晓哥 | 来源:发表于
2017-10-18 15:11 被阅读23次#pragma mark - 根据webView内容高度自适应
- (void)webViewDidFinishLoad:(UIWebView *)webView{
CGFloat webViewHeight =[[webView stringByEvaluatingJavaScriptFromString:@"document.body.offsetHeight"]floatValue]; //获取webView内容高度
CGRect newFrame = webView.frame;
newFrame.size.height= webViewHeight;
//webView.frame= newFrame;
self.webViewHeight = newFrame.size.height;
}
本文标题:iOS 通过原生按钮,控制webView显示范围,达到折叠展开的
本文链接:https://www.haomeiwen.com/subject/inqeuxtx.html
网友评论