【发布时间】:2011-04-14 20:28:50
【问题描述】:
嗨!我正在使用 UITableView 和 UITableViewCell。 UITableViewCell 在 UIWebView 内部(因为我正在使用实体、粗体文本、ecc...)。
webview 加载了这段代码:
UIWebView *testoLabel2 = (UIWebView*)[cell viewWithTag:3];
NSString *html = [NSString stringWithFormat:@"<html><font size=2>%@</font></body></html>", sottotitolo];
testoLabel2.opaque = NO;
testoLabel2.backgroundColor = [UIColor clearColor];
[testoLabel2 loadHTMLString:html baseURL:nil];
有什么问题? 当我需要重新加载数据时(例如在改变 deviceOrientation 之后)使用
[my_table reloadData];
所有的 webView 都在闪烁! 只是一秒钟,但他们眨眼!而且效果很丑!
你知道为什么吗? 谢谢!
编辑:如果我向下滚动 tableview,当我向上滚动之前加载的 webview 是白色的!但只是片刻,在他们加载文本之后!
【问题讨论】:
-
这是因为 webViews loadHtmlString 是异步执行的。我遇到了同样的问题,我发现的唯一解决方案是使用接受 html 的richText 并用它替换 webView。
标签: iphone uitableview uiwebview