开发者

Block touch propagation to another view

I开发者_如何转开发 have a child view that puts itself over other sibling views. The problem is that when I touch it, the sibling also reacts at the touch event. How can I disable touch propagation on the underlying sibling views?


In theory, if you overlap the tab bar with a view with exclusiveTouch = YES, it should not respond to this touch, either.

Try setting exclusiveTouch = YES and, maybe, add the overlay view as a subview of tabBarController.view (and bring it to the front).


I assume that your views react on the same selector. Look at InterfaceBuilder to the Connections Inspector which action reacts on which event. If this fails, you can stop a view of reacting on user interaction with:

UIView userInteractionEnabled
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜