Search code examples
iosuiscrollviewtouchesmoved

horizontal scrolling of a scrollView in a scrollView - small problem


i have a scrollView that fits the whole screen. In that View i show some UIImages that scroll horizontally. Like in the PageControl Project from Apple. Then, when the user taps the screen, i fade in a scrollView at the bottom with some other images. Also horizontally scrolling. Like in the ScrollView Project from Apple.

My problem is, that when i come to the end of the scrollView which was faded in, the upper scrollView also starts to drag. How can i stop that during activation of the second scrollView?


Solution

  • Redraw the frame limits on your first scrollView when the second enters the screen. That way, your touches won't respond to both views. This means you need a container-view to keep both views seperated from each other.

    Then you just rescale it back whenever your second scrollView disappears.

    Edit: or disable scroll in your first scrollview while the second is open.