将 uiimageView 定向到屏幕中心
好吧,我有几张计划图像,每次我们打开应用程序时,它们都会在随机位置创建。我想要的是,每次创建计划时,他的鼻子都朝向屏幕中心,我认为我必须计算中心和图像之间的角度,然后进行旋转,但我不确定。你能帮我吗?抱歉我的英语我是法国人:/
Well I have several images of plans that, every time we open the application, are created at a random position. What I want, is that every time a plan is created, his nose is oriented to the center of the screen, I think that I must calculate the angle between the center and the image and then do a rotation, but I'm not sure . Can you help me please ! sorry for my english I'm french :/
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
要获得所需的角度,您需要进行三角操作。
http://en.wikipedia.org/wiki/Sine
to get the angle that you need you need to do trig.
http://en.wikipedia.org/wiki/Sine