美文网首页
UITableView 刷新闪烁问题

UITableView 刷新闪烁问题

作者: 天要下雨00 | 来源:发表于2016-08-08 12:25 被阅读0次

方法1

UILable 显示 html文字 出的问题解决,使用多线程创建 attribute 对象

dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT,0), ^{

//耗时的操作

NSAttributedString* remainNumStr = [[NSAttributedStringalloc]initWithData:[remainnumStrdataUsingEncoding:NSUnicodeStringEncoding]options:@{NSDocumentTypeDocumentAttribute:NSHTMLTextDocumentType}documentAttributes:nilerror:nil];

dispatch_async(dispatch_get_main_queue(), ^{

//更新界面

self.contentLabel.attributedText=remainNumStr;

});

});

方法2

更改刷新数据的方法

[tableview  reloadData]

改为:

[self.tableViewreloadSections:[NSIndexSetindexSetWithIndex:0]withRowAnimation:UITableViewRowAnimationNone];

相关文章

网友评论

      本文标题:UITableView 刷新闪烁问题

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