gpt4 book ai didi

iphone - 如何使用触摸旋转图像

转载 作者:行者123 更新时间:2023-12-03 20:23:39 25 4
gpt4 key购买 nike

谁能告诉我如何根据用户给出的触摸旋转 View ......

我的意思是我想要像旧电话一样的外观(按下并旋转拨号...)... alt text

我很清楚如何旋转,但无法根据这种情况旋转......

最佳答案

您需要一个仅包含表盘图像的 View 。

This view has a center C(x,y)
First, the view will be touched at coordinate T0(x,y)

if the x and y is within the circle do the tracking:
Then the finger will move to coordinate Tn(x,y)
Find the angle made up by Tn(x,y) C(x,y) T0(x,y) //(See below for a reference)
and do the rotation using that angle as you already know ;)
else
do nothing since the touch is not in the dial

引用号:How to calculate an angle from three points

关于iphone - 如何使用触摸旋转图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4711099/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com