我正在努力处理android xml动画。我想绕其中心点逆时针旋转图像。
这是我的动画xml:
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:fillAfter="true" >
<rotate
android:duration="1000"
android:repeatCount="infinite"
android:repeatMode="restart"
android:fromDegrees="360"
android:toDegrees="0"
android:pivotX="0.5"
android:pivotY="0.5"
android:interpolator="@android:anim/linear_interpolator"
/>
当前动画没有使图像绕点x = 0旋转;y = 0。
代表@Mahfa回答
您必须将pivotX和pivotY设置为“ 50%”
重要的部分是百分比。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句