使用 CGAffineTransform 的 UIView 旋转

发布于 2024-10-23 13:06:42 字数 180 浏览 9 评论 0原文

我想使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

半﹌身腐败 2024-10-30 13:06:42

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文