I have a transparent overlay that I’d like to put over a UIScrollview. I’m adding it as an Imageview sibling view to the scrollview so that it remains stationary while the scrollview subviews move freely underneath. The problem is that views pass their events to the superview, not the siblings. IS there a way to pass events from this overlay to the scrollview? Or can anyone think of a better way to achieve the same effect? Thanks!
Share
This should Just Work, as long as the
UIImageViewhas itsuserInteractionEnabledproperty set toNO: the superview sends-hitTests:withEvent:to its subviews in order, and theUIImageViewshould returnnil, whereas theUIScrollViewshould return itself (because it has gesture recognizers).If it’s not working for you, the chances are that your view layout is not what you think it is.
UIViewhas a useful method called-recursiveDescriptionwhich you should call on the superview and NSLog the result.