我想为我的视图制作一个旋转动画但是在两边(java和xml)我无法找到任何方法从它的中心旋转视图
<rotate xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="500"
android:fromDegrees="0"
android:pivotX="50%"
android:pivotY="50%"
android:repeatCount="infinite"
android:repeatMode="reverse"
android:toDegrees="180" />
Run Code Online (Sandbox Code Playgroud)
还有这个:
RotateAnimation animation = new RotateAnimation(0,180,
Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF,
0.5f);
Run Code Online (Sandbox Code Playgroud)
它们都从角落旋转视图
请帮我