zepojo / UPCarouselFlowLayout

A fancy carousel flow layout for UICollectionView on iOS.
MIT License
1.66k stars 236 forks source link

After reloading, the first or last cell is not centered aligned. #68

Open banuharshavardhan opened 2 years ago

banuharshavardhan commented 2 years ago

I have few cells in my collection view, now I deleted the first cell or last cell. After deleting I'm reloading the collection view, here the next cell or previous cell (first or last based on deletion) was not horizontally centered aligned. If user scroll the content then only the cell alignment is adjusting. I tried to move programatically by using setContentOffset, scrollToItem, scrollToRect but none of them worked. First and second screenshots were related to the issue after collection view reload due to deletion of first and last record respectively. The last/third screenshot belongs to expected layout, which got if user swipes on the screen

After reload when first item deleted: Simulator Screen Shot - iPhone 11 - 2021-09-29 at 14 01 06

After reload when last item deleted: Simulator Screen Shot - iPhone 11 - 2021-09-29 at 14 04 22

After user move the screen: Simulator Screen Shot - iPhone 11 - 2021-09-29 at 13 58 11

akash-611 commented 1 year ago

have you found the solution?

AhmedShammala commented 1 month ago

+1