美文网首页移动开发
IOS 屏幕手指滑动点追踪

IOS 屏幕手指滑动点追踪

作者: JakieZhang | 来源:发表于2016-12-21 12:56 被阅读183次

-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent*)event {

UITouch*pTouch = touches.anyObject;

//self.view

CGPointposition = [pTouchlocationInView:self.view];

//self.myView

CGPointposition2 = [pTouchlocationInView:self.myView];

NSLog(@"开始1 %@",NSStringFromCGPoint(position));

NSLog(@"开始2 %@",NSStringFromCGPoint(position2));

}

-(void)touchesMoved:(NSSet *)touches withEvent:(UIEvent*)event {

UITouch*pTouch = touches.anyObject;

CGPointposition = [pTouchlocationInView:self.view];

NSLog(@"移动%@",NSStringFromCGPoint(position));

}

-(void)touchesEnded:(NSSet *)touches withEvent:(UIEvent*)event {

UITouch*pTouch = touches.anyObject;

CGPointposition = [pTouchlocationInView:self.view];

NSLog(@"抬起%@",NSStringFromCGPoint(position));

}

相关文章

  • IOS 屏幕手指滑动点追踪

    -(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent*)...

  • touch事件

    touchstart: 手指放到屏幕上时触发 touchmove: 手指在屏幕上滑动式触发 touchend:手指...

  • 移动端Touch事件

    touchstart: //手指放到屏幕上时触发touchmove: //手指在屏幕上滑动式触发touchend:...

  • scrollView

    手指晃动scollview,停止滑动,然后离开屏幕

  • View的速度追踪和手势检测

    View的速度追踪 Android中使用VelocityTracker用于追踪手指在滑动过程中的速度,包括水平和竖...

  • iOS 中事件的产生,传递和响应

    事件 在iOS中事件UIEvent主要分为以下3大类: 触摸事件: 手指触摸屏幕,点击,滑动等 加速计事件: 主要...

  • JS事件

    一、四种touch触摸事件 事件 touchstart手指放在屏幕上时触发。 touchmove手指在屏幕滑动时持...

  • touch-action属性

    项目里面出现增加了一个横向滚动的商品(整个屏幕是可以上下滑动的)。手指按在横向商品区时在ios上可以上下滑动,但是...

  • js触屏事件

    触屏事件,首先要有硬件支持,触屏设备 1.touchstart:手指按下屏幕触发 touchmove:手指滑动屏幕...

  • Player移动控制

    要求 1、支持手机端手指触屏滑动,控制物体移动;2、不能超出屏幕边界(左、上、右、下) 知识点 1、手指输入,当前...

网友评论

    本文标题:IOS 屏幕手指滑动点追踪

    本文链接:https://www.haomeiwen.com/subject/vhdqvttx.html