Android loadAnimation的XML等价物
Android的loadAnimation功能有XML等价物吗?我想在布局XML中指定要应用于视图的动画 我在动画资源中定义了一个动画:Android loadAnimation的XML等价物,android,animation,Android,Animation,Android的loadAnimation功能有XML等价物吗?我想在布局XML中指定要应用于视图的动画 我在动画资源中定义了一个动画: <?xml version="1.0" encoding="utf-8"?> <rotate xmlns:android="http://schemas.android.com/apk/res/android" android:fromDegrees="0" android:toDegrees="359"
<?xml version="1.0" encoding="utf-8"?>
<rotate
xmlns:android="http://schemas.android.com/apk/res/android"
android:fromDegrees="0"
android:toDegrees="359"
android:pivotX="50%"
android:pivotY="50%"
android:duration="10000"
android:repeatCount="infinite" />
无法从XML执行此操作:
ImageButton main_button = (ImageButton)this.findViewById(R.id.imageButton1);
Animation rotateAnimation = AnimationUtils.loadAnimation(this, R.anim.my_rotate);
main_button.startAnimation(rotateAnimation);