开发者

iphone - setUserInteractionEnabled problem

开发者 https://www.devze.com 2023-03-14 21:49 出处:网络
I have a pa开发者_高级运维rent view contain a child custom view and many buttons. When I click on a button, it shows a child view and set [parentView setUserInteractionEnabled:NO]. Then I set

I have a pa开发者_高级运维rent view contain a child custom view and many buttons. When I click on a button, it shows a child view and set [parentView setUserInteractionEnabled:NO]. Then I set [childView setUserInteractionEnabled:YES]. But it's not working, the child view isnot able to be enabled. I don't why. Please help me.

Thanks


 [parentView setUserInteractionEnabled:NO];

The snippet above disables user interaction for the parentView and all its subviews. So even if you follow it up with,

 [childView setUserInteractionEnabled:YES];

it won't work. You might want to rethink disabling user interaction on the parent view or do not add the childView as its subview.

0

精彩评论

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