提问者:小点点

如何在每次单击按钮时顺时针旋转imageview 10度


我有一个图像视图和一个按钮,我想要什么,当我点击按钮我想旋转图像视图10度。请帮帮我。

下面是我使用的代码

<set xmlns:android="http://schemas.android.com/apk/res/android" android:interpolator="@android:anim/cycle_interpolator">
<rotate android:fromDegrees="360"
    android:toDegrees="0"
    android:pivotX="50%"
    android:pivotY="0"
    android:duration="5000" />
<set xmlns:android="http://schemas.android.com/apk/res/android" android:interpolator="@android:anim/cycle_interpolator">
<rotate android:fromDegrees="0"
    android:toDegrees="10"
    android:pivotX="50%"
    android:pivotY="50%"
    android:startOffset="0"
    android:duration="1500" />

共1个答案

匿名用户

view.animate().rotation(10).start();