I read through the documentation, and here are my findings.

UIButton inherits from UIControl the
boolean property enabled

A Boolean value that determines whether the receiver is enabled.

Specify 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.

UIControl inherits from UIView the
boolean property userInteractionEnabled:

A Boolean value that determines whether user events are ignored and removed from the event queue.

When set to NO, user events—such as touch and keyboard—intended for the view are ignored and removed from the event queue. When set to YES,
events are 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 = NO means the button
    is grayed out and doesn't respond to touches (from the UIControl inheritance).

总的来说, userInteractionEnabled = NO,view看起来还是正常的,可是不能响应点击事件。

enabled = NO。 view会变灰。假设有文字,文字也会变灰色。view也不能响应点击事件。

Difference between enabled and userInteractionEnabled properties的更多相关文章

  1. [MS SQL Server]SQL Server如何开启远程访问

    在日常工作中,经常需要连接到远程的MS SQL Server数据库中.当然也经常会出现下面的连接错误. 解决方法: 1. 设置数据库允许远程连接,数据库实例名-->右键--->属性---C ...

  2. anonymousIdentification 与匿名访问

    anonymousIdentification 元素(ASP.NET 设置架构) 来自 <https://msdn.microsoft.com/zh-cn/library/91ka2e6a(v= ...

  3. Spring Boot 添加Shiro支持

    前言: Shiro是一个权限.会话管理的开源Java安全框架:Spring Boot集成Shiro后可以方便的使用Session: 工程概述: (工程结构图) 一.建立Spring Boot工程 参照 ...

  4. Microsoft Win32 to Microsoft .NET Framework API Map

    Microsoft Win32 to Microsoft .NET Framework API Map .NET Development (General) Technical Articles   ...

  5. iOS开发——UI基础-UIScrollView

    一.UIScrollView使用的步骤 1.创建UIScrollView 2.将需要展示的内容添加到UIScrollView中 3.设置UIScrollView的滚动范围 (contentSize) ...

  6. Infragistics 汉化

    Infragistics 汉化实例: Infragistics.Shared.ResourceCustomizer rc=Infragistics.Win.UltraWinGrid.Resources ...

  7. iOS开发——UI篇&ScrollView详解

    创建方式 1:StoryBoard/Xib 这里StoarBoard就不多说,直接拖就可以,说太多没意思,如果连这个都不会我只能先给你跪了! 2:代码: CGRect bounds = [ [ UIS ...

  8. ScrollView详解

    创建方式 1:StoryBoard/Xib 这里StoarBoard就不多说,直接拖就可以,说太多没意思,如果连这个都不会我只能先给你跪了! 2:代码: 1 2 3 CGRect bounds = [ ...

  9. mapping 详解1(mapping type)

    映射(mapping) 映射是定义一个文档以及其所包含的字段如何被存储和索引的方法. 例如,用映射来定义以下内容: 哪些 string 类型的 field 应当被当成当成 full-text 字段 哪 ...

随机推荐

  1. [小工具] Command-line CPU Killer(附源码及下载链接)

    博主有次在拆卸自己的笔记本电脑后,发现电脑如果静置时间长了有时会重启,但奇怪的是当我自己在电脑前工作的时候从来没有重启过.据此推测可能 CPU 完全空闲的时候风扇完全停转了,虽然 CPU 温度不高,但 ...

  2. Android 自定义控件玩转字体变色 打造炫酷ViewPager指示器

    1.概述 本篇博客的产生呢,是因为,群里的哥们暖暖给我发了个效果图,然后问我该如何实现顶部ViewPager指示器的字体变色,该效果图是这样的: 大概是今天头条的app,神奇的地方就在于,切换View ...

  3. Sass运算

    加法在 CSS 中能做运算的,到目前为止仅有 calc() 函数可行.在 Sass 中,运算只是其基本特性之一.在 Sass 中可以做各种数学计算.加法运算是 Sass 中运算中的一种,在变量或属性中 ...

  4. lvm拉伸逻辑卷分区小总结

    文件系统                                      容量     已用      可用     已用% 挂载点 /dev/mapper/vg_znl-lv_root   ...

  5. Oracle怎样方便地查看报警日志错误

    由于报警日志文件很大,而每天都应该查看报警日志(查看有无“ORA-”,Error”,“Failed”等出错信息),故想找到一种比较便捷的方法,查看当天报警日志都有哪些错误. 在网上查了几天的资料,尝试 ...

  6. oracle 查询前一小时、一天、一个月、一年的数据

    查询一小时 select concat(to_char(sysdate,'yyyy-mm-dd ')||(to_char(sysdate,'hh24')-1),':00:00') start_time ...

  7. ZOJ3549 Little Keng(快速幂)

    转载请注明出处: http://www.cnblogs.com/fraud/          ——by fraud Little Keng Time Limit: 2 Seconds      Me ...

  8. uva 10222 - Decode the Mad man

    #include <iostream> #include <string> #include <cctype> using namespace std; int m ...

  9. [每日一题] OCP1z0-047 :2013-07-25 权限――角色与对象权限

    有疑问可以去itpub讨论:http://www.itpub.net/thread-1804842-1-1.html 按题意,操作如下: 1.创建一个角色r1 sys@OCM> create r ...

  10. mysql定时执行及延时执行,实现类似sql server waitfor功能

    熟悉SQL Server的人都知道,它有一个很有用的功能,waitfor time和waitfor delay,前者表示在某个时间执行,后者表示等待多长时间执行.在我们测试功能和定时执行的时候特别有用 ...