使用 CGAffineTransform 的 UIView 旋转
我想使用 CGAffineTransform 旋转 UIView,并且我可以使用 CGAffineTransform 旋转视图。
但我想基于滑动手势在手指触摸时平滑旋转 UIView。
因此,就像向右滑动、向左滑动一样,我能够检测到滑动,但是当我从下到右或从下到左滑动时,我无法检测到这些类型的滑动手势......
I want to rotate an UIView using CGAffineTransform and I'm able to rotate View using CGAffineTransform.
But I want to rotate UIView smoothly on finger touch based on swipe gestures.
So like right swipe, left swipe I was able to detect swipe but when I swipe from down to right or from down to left, I'm not able to detect swipe gesture of these types...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Sanjay 这些是 iPhone 支持的唯一允许的手势
http://developer.apple.com/library/ios/#DOCUMENTATION/UIKit/Reference/UISwipeGestureRecognizer_Class/Reference/Reference.html#//apple_ref/occ/instp /UISwipeGestureRecognizer/direction
所以我认为您正在尝试识别对角滑动手势,但它不起作用。
并且滑动手势还需要最少 numberOfTouchesRequired 。
http://developer.apple.com/library/ios/#DOCUMENTATION/UIKit/Reference/UISwipeGestureRecognizer_Class/Reference/Reference.html#//apple_ref/occ/cl/UISwipeGestureRecognizer
如果你想旋转UIView 对象比我认为您会在此链接中找到代码
在触摸时旋转视图希望
这有帮助。
Sanjay these are the only allowable gestures that a iPhone supports
http://developer.apple.com/library/ios/#DOCUMENTATION/UIKit/Reference/UISwipeGestureRecognizer_Class/Reference/Reference.html#//apple_ref/occ/instp/UISwipeGestureRecognizer/direction
so I think you are trying to recognize a diagonal swipe gesture and the its not working.
and also there is a minimum numberOfTouchesRequired required for swipe gesture.
http://developer.apple.com/library/ios/#DOCUMENTATION/UIKit/Reference/UISwipeGestureRecognizer_Class/Reference/Reference.html#//apple_ref/occ/cl/UISwipeGestureRecognizer
And if you want to rotate a UIView object than I think you will find the code in this link
rotating a view on touch
Hope this helps.