iOS开发-- 开发细节(webView自适应高度)

来源:互联网 发布:java游戏移植官网 编辑:程序博客网 时间:2024/05/29 11:12

通过JS方法得到WebView的高度


- (void)webViewDidFinishLoad:(UIWebView *)webView{    NSInteger height = [[webViewstringByEvaluatingJavaScriptFromString:@"document.body.scrollHeight"]integerValue];    self.webView.frame=CGRectMake(0,20, self.view.frame.size.width,height);}


0 0
原创粉丝点击