我在我的用户界面上放置一个透明的UIView
来检测点按手势。我的UI中还有一些UIButton
需要保持活动状态。
透明视图下方的UIButton
是否会与UITapGestureRecognizer
发生冲突?
答案 0 :(得分:1)
我尝试了TapRegocnizer的所有选项,这就是结论:
C B E
Recognizer and Buttons react
x Recognizer and Buttons react
x Only Recognizer works
x x Only Recognizer works
x Only Recognizer works
x x Only Recognizer works
x x Only Recognizer works
x x x Only Recognizer works
Legend:
C: Canceled in View
B: Delayed Begin
D: Delayed End
看起来TapRecognizer总是被触发,即使它下面有一个按钮。如果未设置Canceled in View
和Delayed Begin
选项,则会激活按钮。因此,要回答我的问题,按钮永远不会超过TapRecognizer。