Skip to content

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

Open
flexme wants to merge 1 commit into
nicklockwood:masterfrom
flexme:fix_rotation_item_index
Open

[Bug Fix] Fix the issue that current item index may be changed after rotation#201
flexme wants to merge 1 commit into
nicklockwood:masterfrom
flexme:fix_rotation_item_index

Conversation

@flexme

@flexme flexme commented Aug 2, 2016

Copy link
Copy Markdown

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 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

flexme commented Aug 2, 2016

Copy link
Copy Markdown
Author

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

@flexme flexme changed the title Fix the issue that current item index may be changed after rotation [Bug Fix] Fix the issue that current item index may be changed after rotation Aug 4, 2016
@flexme

flexme commented Aug 4, 2016

Copy link
Copy Markdown
Author

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

@flexme

flexme commented Aug 21, 2016

Copy link
Copy Markdown
Author

Hmm, is this project still being maintained?

@michafaw michafaw left a comment

Copy link
Copy Markdown

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)

@AlexAstilean

Copy link
Copy Markdown

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?

@aravasio

Copy link
Copy Markdown

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

@sQu1rr

sQu1rr commented Jan 15, 2017

Copy link
Copy Markdown

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

dimovskidamjan pushed a commit to dimovskidamjan/SwipeView that referenced this pull request Feb 24, 2017
Fixes an issue where current item index was being changed on device
rotation.
dimovskidamjan added a commit to dimovskidamjan/SwipeView that referenced this pull request Feb 24, 2017
@dimovskidamjan

Copy link
Copy Markdown

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

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

Successfully merging this pull request may close these issues.

7 participants