[九九Tips]- http://www.jianshu.com/users/bab86b3e8aa3/latest_articles
enabled和userInteractionEnabled的区别
下面两种设置都能使按钮不能被点击
button.enabled = NO;
button.userInteractionEnabled = NO;
区别是:
userInteractionEnabled不改变按钮状态,仅仅使得按钮不能被点击.
enabled更改会改变按钮状态.
举个例子
[button setTitleColor:[UIColor redColor] forState:UIControlStateDisabled];
button.enabled = NO; 按钮进入UIControlStateDisabled状态;
button.userInteractionEnabled = NO; 按钮不会进入UIControlStateDisabled状态.