1
UIImageView在單元格閃爍我知道SDWebImage將清除應用程序進入後臺時的內存緩存。 所以,當應用程序進入前景,滾動tableView刷新,然後reloadData,單元格中的imageView將閃爍,即使數據沒有改變。當tableView reloadData
[cell.toolsImageView sd_setImageWithURL:[NSURL URLWithString:toolsModel.iconUrl] placeholderImage:[UIImage imageNamed:@"morentu_circle"] options:SDWebImageRetryFailed];
除了判斷模式的轉變,是否有任何其他的方式來避免閃爍?圍繞reloadData
閃爍步驟:reloadData之前
顯示圖像;
reloadData和imageView重置圖像的URL;
在SD內存緩存中找到圖像,但未找到;
在SD磁盤緩存中找到圖像,將其設置爲異步;
更改爲顯示placeholderImage;
加載磁盤映像。