Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disable UIView and controls

When a user clicks on a button a popup similar to this image appears. But when i am on a slow internet, the popup takes awhile to load. so until the popup loads i need the view in the background (where the button resides) to freeze (disable) and the user should not be able to click on any controls.

How can i disable the view/control ?

like image 672
Dexter Avatar asked Jan 20 '26 11:01

Dexter


2 Answers

See -[UIView userInteractionEnabled]

http://developer.apple.com/library/ios/documentation/uikit/reference/uiview_class/uiview/uiview.html#//apple_ref/occ/instp/UIView/userInteractionEnabled

Set

view.userInteractionEnabled = NO;

On the parent view of the controls you'd like disabled.

like image 200
Todd Ditchendorf Avatar answered Jan 23 '26 01:01

Todd Ditchendorf


Set the button's enabled property to NO - if you're using UIButton or a subclass thereof.

ex.

[button setEnabled:NO];
like image 38
W Dyson Avatar answered Jan 22 '26 23:01

W Dyson



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!