iphone – UISwipeGestureRecognizer手势起点

iphone – UISwipeGestureRecognizer手势起点,第1张

概述是否可以从UISwipeGestureRecognizer获取手势起点.喜欢它的可能性 - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { UITouch * touch = [touches anyObject]; gestureStartPoint = [touch locationInView 是否可以从UISwipeGestureRecognizer获取手势起点.喜欢它的可能性

- (voID)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {    UItouch * touch = [touches anyObject];    gestureStartPoint = [touch locationInVIEw:self];}
解决方法 根据 UISwipeGestureRecognizer documentation你可以:

You may determine the location where a swipe began by calling the UIGestureRecognizer methods locationInVIEw: and locationOftouch:inVIEw:. The former method gives you the centroID if more than one touch was involved in the gesture; the latter gives the location of a particular touch.

PS:你真的应该先看看文档,答案是在UISwipeGestureRecognizer的类引用中,应该不难找到.作为开发人员的一部分是能够查找的东西,Apple有优秀的文档,使用它!

总结

以上是内存溢出为你收集整理的iphone – UISwipeGestureRecognizer手势起点全部内容,希望文章能够帮你解决iphone – UISwipeGestureRecognizer手势起点所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/web/1031312.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-23
下一篇 2022-05-23

发表评论

登录后才能评论

评论列表(0条)

保存