Open ssfking opened 10 years ago
You have to cache the sizes yourself. Here's how I did it:
Then it's super smooth. Just clear the cache before you reload the collection view or insert/delete cells.
Experienced a similar problem: basically as soon as we've implemented sizeForItemAtIndexPath
the UI would become laggy with many elements (50'000+).
It doesn't matter what the implementation looks like though, even if we return a reference to always the same "size" the performance would degrade. If I remove the implementation then performance is good again.
cc @fresswolf
Gets super laggy if using variable sized (height) cell, which is pretty common. Seems like PrepareLayout keeps getting called on scrolling, which in turn tries to find the height for EACH one of the 10000 cells...