0

I have a scroll view that contains text and images.

What I want to achieve is, when the scroll view content is at the top of the view and the scroll view is being pulled down, instead of only dragging the scroll view, I want to drag the parent view down.

I don't want the parent view to be dismissed immediately.

I would like the parent view y position to match the offset of the content of the scroll view.

enter image description here

Above is an image of what I want to achieve. The text 'The Salutaion' is in a scroll view. This normally sits just below the top of the parent view. The text is being dragged down, but as you see the parent view shows a big gap of white.

Wesley Skeen
  • 1,164
  • 3
  • 14
  • 22

1 Answers1

0

I resolved this by restricting the offset of the scrollView and setting the container views y position to the offset of the scroll.

self.scrollContainerView.frame.origin.y = self.scrollContainerView.frame.origin.y - scrollOffset
self.scrollView.contentOffset.y = 0
Wesley Skeen
  • 1,164
  • 3
  • 14
  • 22