New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Performance of layoutAttributesForElementsInRect: is poor when UICollectionView has many thousands of cells #13
Comments
Any test procedure ? Or, could you send a pull request? |
Sure, I can do this in the next day or so! |
The general test case is: Add 10,000+ items to the grid and try to scroll on an iphone 4 :) |
Hi, guys, any good news. I use this layout for waterfall, once there are too many pics, the performance is very bad. |
Hey guys, could you try the latest commit and see if there's any improvement? |
This seems to be helping quite a bit! I have noticeably less jitters now when scrolling! Thank you very much for getting around to this. I found one minor bug with the new implementation: the "end" variable on line 142 could technically be larger than the number of elements in the CollectionView (causing an out of bounds exception). I've fixed it by putting this on line 162: end = MIN(_itemCount, end); |
I'm actually seeing some issues with cell spacing now (sometimes there are large gaps between cells that don't belong there). I'll have to look into this further, later. I've reverted for now. |
Hi, could you give the latest commit a try? |
layoutAttributesForElementsInRect,this method will return a rectangle,and how this rectangle stated? |
@LiDechao what's your question? maybe you should create another issue for this? |
This function is spending a considerable amount of time calculating the layoutAttributes during scrolling which lowers the frame rate significantly :(
The text was updated successfully, but these errors were encountered: