WebView 高度自适应

2016-11-28  本文已影响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);

}
上一篇下一篇

猜你喜欢

热点阅读