开发者

UIButton under UIView should NOT be clickable

开发者 https://www.devze.com 2023-04-01 19:44 出处:网络
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 button

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开发者_JS百科't, though.

How can I prevent the buttons from reacting to taps?


Setting,

semiTransparentViewOnTopOfAll.userInteractionEnabled = YES;

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

semiTransparentViewOnTopOfAll.exclusiveTouch = YES; 


do like this

button.userInteractionEnabled=NO;

by getting all buttons from view

0

精彩评论

暂无评论...
验证码 换一张
取 消