美文网首页
WebView 高度自适应

WebView 高度自适应

作者: 灰斗儿 | 来源:发表于2016-11-28 11:27 被阅读32次
-(void)webViewDidFinishLoad:(UIWebView *)wb{

        CGRect frame = wb.frame;
        frame.size.width = SCREEN_WIDTH;
        frame.size.height = 1;

        wb.frame = frame;
    
        frame.size.height = wb.scrollView.contentSize.height;
        NSLog(@"frame = %@", [NSValue valueWithCGRect:frame]);
        wb.frame = frame;
    
        _showScroll.contentSize = CGSizeMake(0, _showScroll.contentSize.height + wb.height);

}

相关文章

网友评论

      本文标题:WebView 高度自适应

      本文链接:https://www.haomeiwen.com/subject/yahopttx.html