2
votes

I've created main scroll view for scrolling between pages on the screen.

It's dark gray area named scroll 1. Next, on this main scroll I've added small scroll 2(light gray area).

enter image description here

Currently, for scroll 2 I can touch and scroll only if touch located at above scroll 1 area. Please check this:

enter image description here

Scroll 2 added at position:

CGRectMake(25, -40, 250, 85)]

So, it's half outside of frame of scroll 1.

I've set:

scroll1.clipsToBounds = NO;

But it's like clipping touches too.. I need to be able to touch scroll 2 even if it's outside of scroll 2. How this problem can be solved?

Also, main thing I need is that when I'm scrolling small scroll 2 - scroll 1 should not catch touches.

1

1 Answers

0
votes

clipsToBounds only covers rendering not touch handling - it will allow your view to be drawn outside the bounds but it does not extend the touch handling.

The easiest way to achieve what you want here is to have a container view that is big enough to hold both scroll views and then add the scroll views to this container instead of adding the small scroll view to the big one.