puzzl
puzzl

Reputation: 831

UIScrollView inside of UIScrollView?

Similar questions have been asked to this, but my predicament is actually the opposite of theirs. I've got a fullscreen, paging UIScrollView, with each page being the size of the screen. Inside of that, I've got some pages that are themselves UIScrollViews, with their width greater than the screen width. The inner scrollviews are within a few layers of other UIViews, they are not direct subviews of the outer scrollview.

What I'd like is that, when I get to the end of one of the inner scrollviews, it starts scrolling the outer scrollview. From other questions I see on here, it looks like that should happen, but for some reason it doesn't. What in my setup could be causing this to stop happening? Where in the touch stack is the hand-off supposed to happen between inner and outer scrolling?

edit: Is there any way to pass touches or pan gesture commands out to the outer scroll view using I sense the inner view is past its bounds via scrollViewDidScroll delegate method?

Upvotes: 8

Views: 364

Answers (2)

tettoffensive
tettoffensive

Reputation: 672

WWDC 2013 Session 217 Exploring Scroll Views on iOS 7 explains in detail how to nest scroll views.

Upvotes: 0

ondermerol
ondermerol

Reputation: 546

You can call the super class touchesBegan delegate as follows


   - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
       [super touchesBegan:touches withEvent:event];
    }

Here is the reference link: How to pass the touch event to superview when userInteractionEnabled = YES?

Upvotes: 1

Related Questions