lukescott / DraggableCollectionView

Extension for the UICollectionView and UICollectionViewLayout that allows a user to move items with drag and drop. --- HELP WANTED --- Looking for maintainer and help with the experimental branch.
MIT License
549 stars 175 forks source link

Section doesn't expand/retract when it should #4

Closed lukescott closed 11 years ago

lukescott commented 11 years ago

When you move a cell to another section and it ends up creating another row that section's height doesn't increase (which should push the others down). The reverse is also true: If you move a cell away from a section and it removes a row, that section's height isn't reduced.

This happens while dragging though. When you let go it corrects itself. The animation was messed up when this happened, but 151958fa0ecd5d61278daf4ec0a8d83dc9324ee1 fixed the animation problem.

One way to fix this is by changing the UICollectionViewLayoutAttribute frames. Essentially detect when a section changes size and add/subtract the X or Y position (depending on the scrolling direction). But this makes the assumption that the layout is a Flow layout... So this can't be implemented in LSCollectionViewLayoutHelper. It would have to be in DraggableCollectionViewFlowLayout, but that's a bit of a hack.

Any "fix" would probably have to be layout specific... It could probably be mitigated slightly by inserting an extra cell to the end of each section.

lukescott commented 11 years ago

Closing this for now. There doesn't seem to be much I can do about this for now.