UITableView 刷新閃爍問題

方法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];

最后編輯于
?著作權歸作者所有,轉載或內容合作請聯系作者
平臺聲明:文章內容(如有圖片或視頻亦包括在內)由作者上傳并發布,文章內容僅代表作者本人觀點,簡書系信息發布平臺,僅提供信息存儲服務。

推薦閱讀更多精彩內容