Above is an example of the layout of how my program should look. The screen should have a simple header view up top and the remaining space below it is used to display other content. This other content is basically 3 pages of stuff. The parent scrollview should display one page at a time but can scroll left or right using paging to get to the other ones. The problem is that each of these pages is going to have different heights. Also, by using paging in the parent view, vertical scrolling also gets paged so I think I have to assign a scrollview for each individual page, each with paging disabled. This process is fairly annoying for autolayout because I have to manually calculate and overide intrinsicContentSize for every single view and make a custom method in viewcontrollers to return the height based on the intrinsic content sizes of its children and constraints used on them. I then need to use this height to constrain the widths and heights of the views so that the container scrollviews are able to calculate their contentsizes using autolayout. I can get stuff to show up using a mess of container uiviews and uiscrollviews but the only scrollview that receives events is the parent scroll view. Why are the child scroll views not responding?
3
votes
1 Answers
2
votes
I had similar issues with nesting UIScrollViews. I found this video from WWDC 2010 (link below) that really helped me to understand how to work with child UIScrollViews inside a paging UIScrollView, and I managed to fix the bugs I had by following the steps in this video and looking at the sample code.
Note: The PhotoScroller code has been updated since the video was recorded to support ARC, storyboards and UIPageViewController. I would suggest taking a look at the sample code first, and if you're not sure how it all works then watch the video.
Hope this helps!