Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UICollection view reloadData cause recreate visible cell

Tags:

When I call reloadData method of UICollectionView it cause all visible cell to blink. I found that reason of this is recreation of all visible cells, while UITableView return visible cell in – tableView:cellForRowAtIndexPath: method after reload data.

So, how can I avoid recreation of visible cells in UICollectionView.

like image 922
abagmut Avatar asked May 17 '14 18:05

abagmut


1 Answers

You need to reload the visible cells, which will not cause the flash seen during reloadData:

[myCollectionView reloadItemsAtIndexPaths:[myCollectionView indexPathsForVisibleItems]];

like image 174
Adam W. Dennis Avatar answered Oct 11 '22 20:10

Adam W. Dennis