ios webview

//#pragma mark - UIWebView Delegate Methods
-(void)webViewDidFinishLoad:(UIWebView *)webView{
    //获取到webview的高度
    CGFloat height = [[_webView stringByEvaluatingJavaScriptFromString:@"document.body.offsetHeight"] floatValue];
    _webView.frame = CGRectMake(_webView.frame.origin.x,_webView.frame.origin.y,kScreenW, height+20);
}

猜你喜欢

转载自www.cnblogs.com/pengyan5945/p/10871235.html