0
votes

I want to add a couple of ScrollViews inside another ScrollView so I can scroll vertical in the outer ScrollView and horizontal in each of the inner ScrollViews. If I add the horizontal ScrollViews directly in the vertical everything work but if I add the horizontal ScrollViews inside a container view the vertical touches isn't passed through to the vertical. I have double checked the contentSize in all ScrollView and they are correct.

This works

UIScrollView (vertical scroll)
 |
 --UIScrollView (vertical scroll)
 |
 --UIScrollView (vertical scroll)

This doesn't work

UIScrollView (vertical scroll)
 |
 -- UIView
    |--UIScrollView (vertical scroll)
 |
 -- UIView
    |--UIScrollView (vertical scroll)

I am able to scroll the outer scrollview in this layout if I touch the container view and not the child scrollview.

To make things even more interesting, I've noticed that the problem only occurs on iPad and not iPhone.

Can I subclass the container view so I can pass the touch events through to the superview?

1
is your outer parent scroll view frame equal to inner (child) scrollview frame?Shwet Solanki
No. The inner scrollview frame is smaller.Johan
Is your outer scroll view contentSize set correctly?Hetal Vora
Yes. I have double checked all contentSizesJohan

1 Answers

0
votes

The problem was that I had paging enabled on both scrollViews and it was conflicting. I solved it by disabling paging on the outer scrollView and implement using the scrollDelegate.