[英]Disable button interaction if below another view
I'd like to disable a button interaction if it is below another view. 如果按钮交互作用位于另一个视图下面,我想禁用它。
On this example, my UIButton is the green frame. 在此示例中,我的UIButton是绿色框。 I can tap on it and it will call the right selector (with control event "UIControlEventTouchUpInside").
我可以点击它,它将调用右边的选择器(带有控制事件“ UIControlEventTouchUpInside”)。 But this call also work if I tap on the red frame which is above the green button, and I don't want that...
但是,如果我点击绿色按钮上方的红色框,那么此呼叫也可以工作,但我不希望这样...
Any help to disable the interaction where the button isn't visible? 是否有任何帮助在按钮不可见的情况下禁用交互?
通过设置固定:
theUpperView.userInteractionEnabled = YES;
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.