【发布时间】:2013-01-20 11:57:52
【问题描述】:
我想增加 webview 的大小,根据 Html 文本行,但我的 web view 大小没有正确,最初我在固定框架中显示内容,后来当用户选择行时我需要根据html文本,请帮我解决这个问题,我使用的代码是
enter code here NSLog(@"web view and selected ==== %d ---%d",webView.tag,selectedRow);
//CGFloat webViewHeight = 0.0f;
if (webView.subviews.count > 0) {
UIView *scrollerView = [webView.subviews objectAtIndex:0];
if (scrollerView.subviews.count > 0) {
UIView *webDocView = scrollerView.subviews.lastObject;
if ([webDocView isKindOfClass:[NSClassFromString(@"UIWebDocumentView") class]])
webViewHeight = webDocView.frame.size.height;
NSLog(@"web view height is %d",webViewHeight);
}
}
【问题讨论】:
标签: iphone uitableview uiwebview