使用触摸手势旋转 UIImageView - iphone dev

发布于 2024-08-17 04:26:46 字数 406 浏览 3 评论 0原文

在这个问题上遇到了真正的麻烦,想知道是否有人找到了解决这个问题的方法。

我希望能够使用触摸手势旋转 UIImageView

->因此,当用户将两根手指放在触摸区域上并旋转手指时,UIImageView 将随之旋转(以用户移动手指的任何方向旋转),

我可以做到这一点,但有一个问题......当 UIImageView 旋转时,它会旋转不保持其形状。好像歪了??这真的很奇怪,我不明白为什么会发生这种情况。

因此,如果我从一个等边正方形开始......当我旋转时,它不会保持为等边正方形,边似乎倾斜并且不保持相等。

我想知道是否有人遇到过这个问题,或者是否有人成功地用触摸手势旋转了 UIImageView 而没有倾斜。

非常感谢有关此问题的任何帮助。

干杯

汤姆

Been having real trouble with this one and wondered if someone may have found a solution to this issue.

I would like to be able to rotate a UIImageView using a touch gesture

-> So when the user places two fingers on the touch area and rotates their fingers the UIImageView will rotate with them (Rotating in whatever direction the user moves their fingers)

I can do this but with one issue.... as the UIImageView rotates it does not keep its shape. It seems to skew?? It is really strange and i can not understand why it is happening.

So if i start with an equal sided square... as i rotate it does not remain as an equal sided square the sides seem to skew and not remain equal.

SOOOO i was wondering if anyone has come across this issue, or if anyone has successfully rotated a UIImageView with a touch gesture without it skewing.

Any help regarding this issue is highly appreciated.

Cheers

Tom

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

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

发布评论

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

评论(1

泼猴你往哪里跑 2024-08-24 04:26:46

您能给我们更多信息吗,例如轮换代码?

希望您正在做类似以下的事情:

[imageView setTransform: CGAffineTransformMakeRotation(M_PI/2)];

Can you give us some more information, like the rotation code?

Hopefully you're doing something like the following:

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