可能重复:
Android - Rotate Dial
Android - Rotate image around center point?
当用户触摸并拖动它时,如何围绕其中心点旋转位图(不是视图或画布)?
我已经尝试了很多关于堆栈溢出的示例,但似乎都没有。
到目前为止,我有:
double r = Math.atan2(posX - dial.getWidth() / 2, dial.getHeight() / 2 - posY);
rotation = (int) Math.toDegrees(r);