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. ExifInterface 多媒体文件附加信息

    简介         ExifInterface类主要描述多媒体文件比如JPG格式图片的一些附加信息,包括拍摄时的光圈.快门.白平衡.ISO.焦距.日期时间等各种和拍摄条件以及相机品牌.型号.色彩编码 ...

  2. DataGrid( 数据表格) 组件[3]

    本节课重点了解 EasyUI 中 DataGrid(数据表格)组件的使用方法,这个组件依赖于Panel(面板).Resizeable(调整大小).LinkButton(按钮).Pageination( ...

  3. 第一篇博客关于Log4net的配置记录

    说明:本程序演示如何利用log4net记录程序日志信息.log4net是一个功能著名的开源日志记录组件.利用log4net可以方便地将日志信息记录到文件.控制台.Windows事件日志和数据库(包括M ...

  4. OD: Heap Exploit : DWORD Shooting & Opcode Injecting

    堆块分配时的任意地址写入攻击原理 堆管理系统的三类操作:分配.释放.合并,归根到底都是对堆块链表的修改.如果能伪造链表结点的指针,那么在链表装卸的过程中就有可能获得读写内存的机会.堆溢出利用的精髓就是 ...

  5. 毕业设计 ASP.Net+EasyUI开发 X X露天矿调度管理信息系统(一)

    开篇介绍关于EasyUI技术,界面部分的一些使用知识,包括控件的赋值.取值.清空,以及相关的使用. 我们知道,一般Web界面包括的界面控件有:单行文本框.多行文本框.密码文本框.下拉列表Combobo ...

  6. uva 12626 - I ❤ Pizza

    #include <iostream> #include <cstdio> #include <string> #include <algorithm> ...

  7. AngularJS指令的作用域

    参考文章:https://segmentfault.com/a/1190000002773689

  8. dede调用指定的多个栏目导航

    {dede:channelartlist row=' typeid='1,2这里输入多个指定的栏目ID' } <li><a href='{dede:field name='typeu ...

  9. PHP优化的总结

    今天看了下PHPBB的相关规范,觉得有很多值得学习之处. 以下就几点PHP的优化做下总结: 1.in_array的用法 避免在大的数组上使用 in_array(),同时避免在循环中对包含20个以上元素 ...

  10. HTML&CSS基础学习笔记1.5-添加常用标签

    代码如下: <!DOCTYPE html><html lang="en"><head>    <meta charset="UT ...