当前位置: 动力学知识库 > 问答 > 编程问答 >

ios - 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.

I can tap on it and it will call the right selector (with control event "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?

网友答案:

Fixed by setting :

theUpperView.userInteractionEnabled = YES;
分享给朋友:
您可能感兴趣的文章:
随机阅读: