控件事件中,简单解释下下面几个事件。

说明:由于是在“iOS 模拟器”中测试的,所以不能用手指,只能用鼠标。

1)UIControlEventTouchDown

指鼠标左键按下(注:只是“按下”)的动作

2)UIControlEventTouchDownRepeat

指鼠标左键连续多次重复按下(注:只是“按下”)的动作,比如,鼠标连续双击、三击、……、多次连击。

说明:多次重复按下时,事件序列是这样的:

UIControlEventTouchDown -> 
(UIControlEventTouchUpInside) -> 
UIControlEventTouchDown -> 
UIControlEventTouchDownRepeat ->  
(UIControlEventTouchUpInside) -> 
UIControlEventTouchDown -> 
UIControlEventTouchDownRepeat -> 
(UIControlEventTouchUpInside) ->

...

除了第一次按下外,后面每次摁下都是一个UIControlEventTouchDown事件,然后紧跟一个UIControlEventTouchDownRepeat事件。

3)UIControlEventTouchDragInside

指按下鼠标,然后在控件边界范围内拖动。

4)UIControlEventTouchDragOutside

与UIControlEventTouchDragInside不同的是,拖动时,鼠标位于控件边界范围之外。但首先得有个UIControlEventTouchDown事件,然后接一个UIControlEventTouchDragInside事件,再接一个UIControlEventTouchDragExit事件,这时,鼠标已经位于控件外了,继续拖动就是UIControlEventTouchDragOutside事件了。

具体操作是:在控件里面按下鼠标,然后拖动到控件之外。

5)UIControlEventTouchDragEnter

指拖动动作中,从控件边界外到内时产生的事件。

6)UIControlEventTouchDragExit

指拖动动作中,从控件边界内到外时产生的事件。

7)UIControlEventTouchUpInside

指鼠标在控件范围内抬起,前提先得按下,即UIControlEventTouchDown或UIControlEventTouchDownRepeat事件。

8)UIControlEventTouchUpOutside

指鼠标在控件边界范围外抬起,前提先得按下,然后拖动到控件外,即 UIControlEventTouchDown -> UIControlEventTouchDragInside(n 个) -> UIControlEventTouchDragExit -> UIControlEventTouchDragOutside(n 个) 时间序列,再然后就是抬起鼠标,产生UIControlEventTouchUpOutside事件。

iOS UIControl 事件的说明(转)的更多相关文章

  1. IOS开发UI基础UIControl事件

    UIControl事件1.UIControlEventTouchDown单点触摸按下事件:用户点触屏幕,或者又有新手指落下的时候. 2.UIControlEventTouchDownRepeat多点触 ...

  2. 给iOS开发新手送点福利,简述UIControl事件的用法

    UIControl事件 1.UIControlEventTouchDown 单点触摸按下事件:用户点触屏幕,或者又有新手指落下的时候. 2.UIControlEventTouchDownRepeat ...

  3. iOS UIControl 详解

    UIControl是UIView的子类,当然也是UIResponder的子类.UIControl是诸如UIButton,UISwitch,UItextField等控件的父类,它本身包含了一些属性和方法 ...

  4. IOS——触摸事件 视图检测和事件传递

    iPhone上有非常流畅的用户触摸交互体验,能检测各种手势:点击,滑动,放大缩小,旋转.大多数情况都是用UI*GestureRecognizer这样的手势对象来关联手势事件和手势处理函数.也有时候,会 ...

  5. iOS开发事件分发机制—响应链—手势影响

    1.提纲 什么是iOS的事件分发机制 ? 一个事件UIEvent又是如何响应的? 手势对于响应链有何影响? 2.事件分发机制 2.1.来源 以直接触摸事件为例: 当用户一个手指触摸屏幕是会生成一个UI ...

  6. IOS触摸事件和手势识别

    IOS触摸事件和手势识别 目录 概述 触摸事件 手势识别 概述 为了实现一些新的需求,我们常常需要给IOS添加触摸事件和手势识别 触摸事件 触摸事件的四种方法 -(void)touchesBegan: ...

  7. IOS 触摸事件分发机制详解

    欢迎大家前往云+社区,获取更多腾讯海量技术实践干货哦~ 作者:MelonTeam 前言 很多时候大家都不关心IOS触摸事件的分发机制的实现原理,当遇到以下几种情形的时候你很可能抓破头皮都找不到解决方案 ...

  8. Jquery 在ios上事件委托失效

    点击通过js遍历出来的列表,跳转页面.点击事件委托在document上, 像这样: $(document).on("click",".nav",function ...

  9. UIControl事件---iOS-Apple苹果官方文档翻译

    本系列所有开发文档翻译链接地址: iOS7开发-Apple苹果iPhone开发Xcode官方文档翻译PDF下载地址 UIControl事件1.UIControlEventTouchDown单点触摸按下 ...

随机推荐

  1. mongoose 建立schema 和model

    在node中使用MongoDB很多情况下,都是使用mongoose的,所以这集来介绍一下 安装 yarn add mongoose 连接 const mongoose = require(" ...

  2. SQL-W3School-高级:SQL RIGHT JOIN 关键字

    ylbtech-SQL-W3School-高级:SQL RIGHT JOIN 关键字 1.返回顶部 1. SQL RIGHT JOIN 关键字 RIGHT JOIN 关键字会右表 (table_nam ...

  3. springboot和hadoop2.7.7集成开发

    1.本人在腾讯云安装hadoop2.7.7,详细安装请看以前的博客 2.pom.xml文件 <?xml version="1.0" encoding="UTF-8& ...

  4. Windows 7开发:UAC数据重定向 - Win32 Native

    Windows 7开发:UAC数据重定向 - Win32 Native 目标 本动手实验中,您将会学习如何: • 故障排除一个文件重定向 问题 • 使用Process Monitor查找引起问题的根本 ...

  5. c++自定义数组越异常 ArrayIndexOutOfBoundsException (学习)

    #include <iostream> using namespace std; const int DefaultSize = 10; class Array{public: Array ...

  6. 阶段5 3.微服务项目【学成在线】_day03 CMS页面管理开发_01-自定义查询页面-服务端-Dao

    在页面输入查询条件,查询符合条件的页面信息. 查询条件如下: 站点Id:精确匹配 模板Id:精确匹配 页面别名:模糊匹配 spring mongoDB如何自定义条件 在Repository的findA ...

  7. Nginx+Keepalived高可用负载均衡

    转自 https://www.jianshu.com/p/da26df4f7d60 Keepalived+Nginx实现高可用Web负载均衡 Master backup vip(虚拟IP) 192.1 ...

  8. Flutter之切换导航TabBar组件

    TabController 这是Tab页的控制器,用于定义Tab标签和内容页的坐标,还可配置标签页的切换动画效果等. TabController的创建有两种形式,一种是使用系统的DefaultTabC ...

  9. jmeter操作—从redis中获取token

    嗨,大家好,我是叶子 背景:某APP项目中需要进行各接口的性能测试,比如:测试商品的搜索功能.店铺查询功能等接口,测试时需要保持登录状态,所以需要获取到登录账号的token,方便之后的接口测试. 准备 ...

  10. python-Web-flask-视图内容和模板

    2 视图内容和模板: 基本使用 #设置cookie值 @app.route('/set_cookie') def set_cookie(): response = make_response(&quo ...