SwipeView icon indicating copy to clipboard operation
SwipeView copied to clipboard

[Bug Fix] Fix the issue that current item index may be changed after rotation

Open flexme opened this issue 8 years ago • 7 comments

This fixes the issue https://github.com/nicklockwood/SwipeView/issues/200 .

Basically when the device is rotated, the scroll view's contentSize may be changed since itemSize may be changed (by method updateScrollViewDimensions). However changing contentSize will result in contentOffset being changed by UIKit, then ScrollView.scrollViewDidScroll will be invoked and change the current item index...

This fix ensures that we update the contentOffset based on current item index when contentSize is changed.

flexme avatar Aug 02 '16 05:08 flexme

BTW, if this is merged, can you release a new version to Cocoapods? Thanks!

flexme avatar Aug 02 '16 07:08 flexme

Nick, can you merge this? We need it and the updated cocoapods to fix the bug in our app. Thanks!

flexme avatar Aug 04 '16 06:08 flexme

Hmm, is this project still being maintained?

flexme avatar Aug 21 '16 06:08 flexme

For me this fixed the problem when rotating from landscape to portrait while on the last item. But the bug can still be reproduced when rotating from portrait to landscape while on the last item. (Iphone SE,7,7+). It jumps to the second to last item. Any suggestions?

AlexAstilean avatar Nov 16 '16 08:11 AlexAstilean

It hurts to see this amazing library no longer mantained, tbh.

aravasio avatar Dec 18 '16 14:12 aravasio

@AlexAstilean this workaround works well for my usecase: http://pastebin.com/tHPaqsaN

sQu1rr avatar Jan 15 '17 23:01 sQu1rr

#208 Fixes this issue with the code that was provided in the pastebin by @sQu1rr .

dimovskidamjan avatar Feb 24 '17 10:02 dimovskidamjan