码迷,mamicode.com
首页 > 其他好文 > 详细

触摸事件MultiTouch Events

时间:2016-05-05 19:21:55      阅读:277      评论:0      收藏:0      [点我收藏+]

标签:

 

备注:

userInteractionEnabled = NO

hidden = YES

alpha = 0.0~0.01    //如果上面三个属性被设置了则无法接收触摸事件

 

 

1、- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event   触摸开始(手指刚碰到view)

备注:

1.1、如果两根手指同时触摸一个view,那么view只会调用一次touchesBegan:withEvent:方法,touches参数中装着2个UITouch对象
2、- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event    触摸ing(手指在view上面挪来挪去)
 
3、- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event    触摸结束(手指离开view)
 
4、- (void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event;      触摸意外取消时执行(例如正在触摸时打入电话)
 
6、touches参数包含的属性
       6.1、window:触摸时所在的窗口
       6.2、view:触摸时所在视图
       6.3、tapCount:短时间内点击的次数
       6.4、timestamp:触摸产生或变化的时间戳
       6.5、phase:触摸周期内的各个状态
      touches包含的方法
       6.6、locationInView:方法:取得在指定视图的位置
       6.7、previousLocationInView:方法:取得移动的前一个位置
 
 
 

触摸事件MultiTouch Events

标签:

原文地址:http://www.cnblogs.com/hepingqingfeng/p/5462724.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!