Skip to content
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

Slider stopping in the middle of the image #55

Open
renanstig opened this issue Jan 11, 2017 · 2 comments
Open

Slider stopping in the middle of the image #55

renanstig opened this issue Jan 11, 2017 · 2 comments

Comments

@renanstig
Copy link

renanstig commented Jan 11, 2017

Hello,

I've been facing a strange issue, when the user move to other viewController in the middle of a scroll when you come back to the previous screen the slider remains static for awhile showing the image wrongly.

I solved this issue by adding a scrollToNextPage() in viewWillAppear function, but I'm wondering if there's a better solution for this issue.

I attached an image in case I wasn't clear enough
simulator screen shot 11 jan 2017 13 30 44

Best regards,
Renan.

@evgenyneu
Copy link
Owner

Hi @renanstig, thank you for reporting the issue and suggesting a solution.

I did not realize that it could happen. He is my hypothesis on why it happens. Auk's autoscrolling calls scrollView.setContentOffset(offset, animated: animated) to show the next page with animation. If you happen to be in the transition to a child view controller the scrolling stops when the parent view controller becomes invisible. It looks like the parent view controller is still in memory but it is frozen. When you click "Back" button, the parent view controller is shown again but the scrolling is not resumed from where it stopped. Hence, we see the scroll view animation in the incomplete state, stuck in the middle.

I think your solution is pretty simple, I don't have an alternative that takes less code to write. Please let me know if you find one.

@SlonGL
Copy link

SlonGL commented Dec 14, 2018

When you change the scrollView.frame, the picture can also hang between the neighbours and the current picture independently and unexpectedly can become one of the neighbouring ones or remain current depending on the size of the frame

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

No branches or pull requests

3 participants