问题描述:

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;
相关阅读:
Top