锚点如何工作 - UIImageView

发布于 2024-10-09 11:16:45 字数 240 浏览 0 评论 0原文

我想围绕一个点旋转,但不是 UIImageView 中的一个点。 我找到了 imageView.layer.anchorPoint 的解决方案,但是当我更改它时,我的 imageView 的位置也发生了变化。我明白为什么,但我无法将 imageView 放在明确的位置并将anchorPoint更改为明确的位置。

我希望我很好地解释了我的问题...

问候, KL94

I wanna make a rotation around a point but NOT a point into my UIImageView.
I found solution with imageView.layer.anchorPoint but when i change it, the position of my imageView change too. I understand why but I can't put my imageView on a definitive position and change the anchorPoint to a definitive position.

I hope I explained my problem well...

Regards,
KL94

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

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

发布评论

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

评论(1

旧情勿念 2024-10-16 11:16:45

一种简单的方法是将 UIImageView 放置在另一个以所需旋转点为中心的 UIView 中。然后,只需旋转该 UIView 即可。

http://mohrt.blogspot.com/2009/05 /rotating-view-around-任意点.html

An easy way is to house your UIImageView in another UIView that is centered at the desired rotation point. Then, just rotate that UIView.

http://mohrt.blogspot.com/2009/05/rotating-view-around-arbitrary-point.html

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