|
I read through the documentation, and here is my findings.
< Code style= "padding:1px 5px; border:0px; White-space:pre-wrap; Background-color:rgb (238,238,238) ">uibutton inherits from uicontrol the boolean property enabled
< Span style= "FONT-FAMILY:SIMSUN; font-size:14px ">a Boolean value that determines whether the receiver is enabled.
S Pecify YES to make the control enabled; Otherwise, specify NO to make it disabled. The default value is YES. IF the enabled state is NO, the control ignores touch events and subclasses may draw differently.
< Code style= "padding:1px 5px; border:0px; White-space:pre-wrap; Background-color:rgb (238,238,238) ">uicontrol inherits from uiview the boolean property userinteractionenabled :
A Boolean value that determines whether user events is ignored and removed from the event queue.
When set to NO, user Events-such as Touch and keyboard-intended for the view is ignored and removed from the event queue. When set to YES, events is delivered to the view normally. The default value is YES.
From this I conclude
-
button.userinteractionenabled = NO means the button looks normal but Doesn ' t respond to touches (from The uiview inheritance).
-
button.enabled = NOmeans the button is grayed out and doesn ' t respond to touches (from the UIControl inheritance).
|
Overall, userinteractionenabled = No,view looks normal, but cannot respond to click events.
Enabled = NO, the view turns gray, and if there is text, the text becomes gray. View also cannot respond to click events.
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
Difference between enabled and Userinteractionenabled properties