首先 userInteractionEnabled 是 UIView 类中的一个属性。
enabled 是 UIControl 类中的一个属性。
UIControl 继承于 UIView。
如果设置 userInteractionEnabled 为 NO,点击方法或者触摸事件之类事件会穿透视图。
而设置 enabled 为 NO 会禁止该控件的交互,并且事件不会穿透。
首先 userInteractionEnabled 是 UIView 类中的一个属性。
enabled 是 UIControl 类中的一个属性。
UIControl 继承于 UIView。
如果设置 userInteractionEnabled 为 NO,点击方法或者触摸事件之类事件会穿透视图。
而设置 enabled 为 NO 会禁止该控件的交互,并且事件不会穿透。