开发者

UIScrollView - Input outwith visible area

开发者 https://www.devze.com 2022-12-18 10:22 出处:网络
I have a UIScrollView to which I add a bunch of UIImageView\'s as sub views. Everything works fine apart from that I get input from the subv开发者_如何学Pythoniews when they are outwith the visible ar

I have a UIScrollView to which I add a bunch of UIImageView's as sub views. Everything works fine apart from that I get input from the subv开发者_如何学Pythoniews when they are outwith the visible area of the scroll view. I would have thought the scroll view would prevent any events from reaching subviews outwith the visible area by default but I presume this isn't the case?

In which case I assume I have to use the content offset, subview positions etc. to calculate whether to prevent the input myself?


UImageView user interaction is not enabled as a default, so you probably enabled it somewhere. You could do a check on the scrollview delegate to see if that imageview is in front by a tag, and if it is not visible disable it.

0

精彩评论

暂无评论...
验证码 换一张
取 消