maxep / MXParallaxHeader

Simple parallax header for UIScrollView
MIT License
1.73k stars 251 forks source link

Stop scrolling before showing Parallax Header again? #77

Closed thephatp closed 5 years ago

thephatp commented 7 years ago

Use case: I have a table view with a long list of items. When scrolling down through the list and then back up to the top, I would like the scrolling to stop before showing the header again, like a backstop.

Walkthrough: Launch app --> parallax header shows at top with tableview half way down, just like in the example. Scroll down the table view until the header is out of sight. Keep scrolling a little more. Now scroll back to the top of the table view with a strong swipe.

Current Behavior: Continues schooling to the header and the header becomes visible.

Desired Behavior: Stop the scrolling such that the table view header is at the top, not showing the parallax header unless the user swipes again with the table view header at the top of the screen.

Is this possible with the current API? If not, any guidance on how to achieve this? I've tried several things to no avail. Trying to override hasn't worked out like I had hoped.

maxep commented 7 years ago

I would suggest to embed you table view in a MXScrollViewController and use the delegate method scrollView:shouldScrollWithSubView: to return NO until your scroll view reach the top. Hope that helps!

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.