我现在有一个UIView,我在上面添加了一个UILongPresessGestureRecognizer,同时,UIView上还有一个UIButton,我对这个UIButton添加了touchUpInside的事件处理。
一般情况下,我按button没啥问题,在整个UIView下长按也没啥问题。
但是如果我在这个UIButton上长按的话,会先触发LongPressGestureRecognizer啦,我的想法是,能够做到按按钮的时候只触发touchUpInside,而忽略UILongPressGresutreRecognizer吗?
对于iOS下的事件传递我始终不是很理解。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
我只能帮你到这了。
能,重写你的view的hitTest
你可以尝试在UIButton上添加一个不做任何事情的UILongPresessGestureRecognizer。
longPressGesture.delayTouchBegan = NO
试试?