使用触摸旋转 uiview(ipad 和 iphone)
我正在尝试设计另一个应用程序,并且正在努力思考最好的方法。我正在寻求一些建议!
如果你想象 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
最好的选择是使用 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.