Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/196.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android RotateAnimation-前后旋转箭头_Android_Animation_Rotateanimation - Fatal编程技术网

Android RotateAnimation-前后旋转箭头

Android RotateAnimation-前后旋转箭头,android,animation,rotateanimation,Android,Animation,Rotateanimation,在我的应用程序中,我将时钟指针旋转到所需的分钟数。这对旋转动画效果很好。现在我要做的是将手放回起始位置(0分钟) 例如: 我首先像这样旋转手: final RotateAnimation anim = new RotateAnimation(0f, ammountDegress, RotateAnimation.RELATIVE_TO_SELF, 0.5f, RotateAnimation.RELATIVE_TO_SELF, 1f); anim.setFillAfter(true); anim.

在我的应用程序中,我将时钟指针旋转到所需的分钟数。这对旋转动画效果很好。现在我要做的是将手放回起始位置(0分钟)

例如: 我首先像这样旋转手:

final RotateAnimation anim = new RotateAnimation(0f, ammountDegress, RotateAnimation.RELATIVE_TO_SELF, 0.5f, RotateAnimation.RELATIVE_TO_SELF, 1f);
anim.setFillAfter(true);
anim.setFillEnabled(true)
然后我想将手移回起始位置,这意味着我应该在第一个动画结束后调用RotateAnimation

问题是枢轴已更改,如何将枢轴位置设置为与前面相同的精确位置?使旋转点再次位于时钟指针的相同位置

编辑使其更清晰-我希望有一个固定点枢轴,它不会随旋转而改变,因此我总是围绕同一点旋转手


我希望你能理解我的意思

+1用于使用浮点参数。。。只是编辑一下。。。rotationAnimationObjectOfHourHand=新的RotationAnimation(getStartAngleOfHourHand(),getEndAngleOfHourHand(),Animation.RELATIVE_TO_PARENT,.027f,Animation.RELATIVE_TO_PARENT,0);使用顺序为“.01”的浮点参数