shabib87 / SHViewPager

A simple view pager for iOS. Compatible with iOS 8.0 or later.
https://www.codewithshabib.com
MIT License
124 stars 25 forks source link

Scroll view content offset reset #1

Closed shabib87 closed 10 years ago

shabib87 commented 10 years ago

When a UIViewController is pushed over the UIViewController that has the SHViewPager, on popping that top UIViewController the content offset of the scroll view of the SHViewPager is reset to zero (0) regardless of the last position of the content offset.

ksandyasa commented 9 years ago

Hello, the bug can be fixed if the UIViewController that has the SHViewPager, call the method [self.viewPager pagerWillLayoutSubviews]; called in - (void)viewWillAppear:(BOOL)animated. In addition, i created method of -(void)moveToTargetIndexWithoutAnimation in SHViewPager.m, duplicate method of moveToTargetIndex but without animation. And the result, when a UIViewController is pushed over the UIViewController that has the SHViewPager, on popping that top UIViewController the content offset of the scroll view of the SHViewPager back to the last position of the content offset.

ksandyasa commented 9 years ago

Anyway, your project library really helps me out, thanks a lot for creating this awesome viewpager for ios!

shabib87 commented 9 years ago

@ksandyasa , thank you! Could you please create a pull to merge request so that this solution can be merged with the master brunch?

ksandyasa commented 9 years ago

I can't push to master branch because i don't have permission to push it aka permission denied..

shabib87 commented 9 years ago

Please fork the source, make the changes and then commit. After that you'll be able to make a pull to merge request.