views:

64

answers:

1

I have a UIScrollView with multiple subviews, each of which shows a page of PDF content. Scrolling works correctly, and now what I am trying to do is get the location when the page currently in view is touched. The touch events are being detected, but the location.x is a negative number. In debugging this I've discovered that the scrollview is detecting the touches in the subview that is essentially the last subview that was added, rather than the one currently in view.

What do I need to do to get the scrollview to detect touches in the currently visible subview?

A: 

But couldn't you just use UITouch's method locationInView: to get the coordinate in your scrollView instead. like so:

[theEvent locationInView: myScrollView];
Max Seelemann
<sigh>. I was passing the subview to locationInView instead of the scrollview. Thanks!
skantner