How to send the touch events of UIScrollView to the view behind it?

后端 未结 3 1239
忘了有多久
忘了有多久 2021-02-19 04:37

i have a transparent UIScrollView on top of another view.

the scroll view has content - text and images, used to display info.

the view behind it has some images

3条回答
  •  情书的邮戳
    2021-02-19 05:31

    The problem is that your UIScrollView is consuming the event. To pass it through, you would have to disable the user's interaction on it, but it wouldn't scroll then. If you have the touches location however, you can calculate where would that fall on the underlying view, using the convertPoint:toView: method, and call a mathod on it by passing on the CGPoint. From there, you can calculate which image was tapped.

提交回复
热议问题