-
Notifications
You must be signed in to change notification settings - Fork 413
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
[Bug Fix] Fix the issue that current item index may be changed after rotation #201
base: master
Are you sure you want to change the base?
Conversation
BTW, if this is merged, can you release a new version to Cocoapods? Thanks! |
Nick, can you merge this? We need it and the updated cocoapods to fix the bug in our app. Thanks! |
Hmm, is this project still being maintained? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works well in our project with no noticeable side effects. 👍
(Bug can be reproduced by rotating when on the last item. It flips to the next to last item. iPad Air, horizontal scrolling, with navigation bar)
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? |
It hurts to see this amazing library no longer mantained, tbh. |
@AlexAstilean this workaround works well for my usecase: http://pastebin.com/tHPaqsaN |
Fixes an issue where current item index was being changed on device rotation.
This fixes the issue #200 .
Basically when the device is rotated, the scroll view's contentSize may be changed since itemSize may be changed (by method
updateScrollViewDimensions
). However changingcontentSize
will result incontentOffset
being changed by UIKit, thenScrollView.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.