Swissdude
Swissdude

Reputation: 3556

UIButton under UIView should NOT be clickable

I have a view with some UIButtons on it. I add another - semi transparent - view on top of all, displaying some information to the user (actually, it's kind of a selfmade modal-alert). But the buttons under the semi-transparent view still react to taps. They shouldn't, though.

How can I prevent the buttons from reacting to taps?

Upvotes: 3

Views: 2055

Answers (2)

EmptyStack
EmptyStack

Reputation: 51374

Setting,

semiTransparentViewOnTopOfAll.userInteractionEnabled = YES;

should solve this problem. But, still if the problem persists, try,

semiTransparentViewOnTopOfAll.exclusiveTouch = YES; 

Upvotes: 13

Narayanan Ramamoorthy
Narayanan Ramamoorthy

Reputation: 826

do like this

button.userInteractionEnabled=NO;

by getting all buttons from view

Upvotes: 1

Related Questions