Skip to content
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

Adding new items to the collection rearranges old cells #21

Open
limenutt opened this issue Mar 12, 2014 · 3 comments
Open

Adding new items to the collection rearranges old cells #21

limenutt opened this issue Mar 12, 2014 · 3 comments

Comments

@limenutt
Copy link

Hi there.
In my Photozeen iOS app I'm loading more images to the photo feed as user scrolls it down. Every time I have new portion of images from server I add them to the collection by calling insertItemsAtIndexPaths.
I see that items are getting rearranged every time. What can I do to make previously loaded items stay still except adding new section for every new portion of images?

@njdehoog
Copy link
Owner

Are you adding every new batch of items to a different section, or are all the images in the same section. The layout is calculated per section, so adding a new section should allow the previous section to remain unchanged. Although I'm not sure if it would redo the calculation for the previous sections as well.

@limenutt
Copy link
Author

Yes, currently I'm using only one section and was looking for workaround without adding new section for every new batch. But looks like it is the only solution, am I right?

@njdehoog
Copy link
Owner

That's right. The implementation of the layout algorithm is such that it tries to determine the best possible layout based on every image in a section, so every time you add a new image it is likely to affect the layout.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants