答案 0 :(得分:0)
尝试使用此代码旋转图像,希望它是png或某些矢量。
private fun rotateLoadingAnimation() {
val rotate = RotateAnimation(0f,
180f, Animation.RELATIVE_TO_SELF,
0.5f, Animation.RELATIVE_TO_SELF,
0.5f)
rotate.duration = 5000
rotate.interpolator = LinearInterpolator()
ivRotating.startAnimation(rotate)
}
答案 1 :(得分:0)
您可以使用clockwise
旋转动画在res/anim/clockwiseanim.xml
中实现这种旋转形式。
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android" android:interpolator="@android:anim/cycle_interpolator">
<rotate android:fromDegrees="0"
android:toDegrees="360"
android:pivotX="50%"
android:pivotY="50%"
android:duration="5000" />
</set>