开发者

Blink when reloadData a UITableView with UIWebView

Hi! I'm working with an UITableView, with UITableViewCell. The UITableViewCell has inside an UIWebView (because i'm using entities, bold text, ecc...).

The webview is loaded with this code:

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开发者_高级运维];

What's the problem? That when i need to reload the data (for example after the change of the deviceOrientation) using

[my_table reloadData];

all the webView blink! For just a second, but they blink! And it's a very ugly effect!

Do you know why? Thanks!

EDIT: also if i scroll down the tableview, when i scroll up the webview that before were loaded are white! But just for a moment, after they load the text!


Not sure exactly why but it's good practice to set all view backgrounds in cells to a solid solid color. The flash could be the cell rendering it's background and then the web view on top of it. If you set the webview background to your desired color and leave it opaque then this shouldn't happen. Good luck!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜