使用触摸旋转 uiview(ipad 和 iphone)

发布于 2024-09-25 04:11:07 字数 306 浏览 2 评论 0原文

我正在尝试设计另一个应用程序,并且正在努力思考最好的方法。我正在寻求一些建议!

如果你想象 ipad(和 iPhone)中间有一个自行车车轮......我希望用户能够点击轮胎并将其向左或向右旋转。根据嗖嗖的速度将驱动轮子旋转的速度。

它应该绕轮子的中心旋转,而不是向任何其他方向移动。

我是否需要使用一些图形代码,或者只是听触摸,检查他们触摸的区域,然后围绕其中心向左或向右旋转图像?

实际上,我正在寻找一些有关使用方法的指示 - 我并不是懒惰并要求代码,但如果有人知道教程 - 那将有很大帮助!

感谢您提供任何信息。

I am trying to design another app and am struggling to think of the best way to do it. I'm after some advice please!

If you imaging a bicycle wheel in the middle of the ipad (and iPhone)... I want the user to be able to click on the tyre and spin it to the left or right. Depending on the speed of the swish will drive the speed of the wheel rotation.

It should rotate around the centre of the wheel and not move any other direction.

Do I need to use some graphics code, or simply listen for the touch, check the area they touched, then rotate the image around it's centre left or right?

Really I'm after some pointers around the methods to use - I'm not being lazy and asking for code, but if anyone knows of tutorials - that would help immensely!!

Thanks for any info.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

睫毛溺水了 2024-10-02 04:11:07

最好的选择是使用 UIGestureRecognizer 之一 子类,可能是 UIPanGestureRecognizer 因为它包括速度。

Apple 的 SimpleGestureRecognizers< /a> 项目将帮助您开始。

Your best bet is to use one of the UIGestureRecognizer subclasses, probably UIPanGestureRecognizer as it includes velocity.

Apple's SimpleGestureRecognizers project will help you get started.

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