Android 安卓-旋转按钮并停止
我有一个按钮小部件,我有一个成功的旋转动画,但它只是回到原来的位置。我怎样才能让它停下来 以下是我的xml文档:Android 安卓-旋转按钮并停止,android,animation,rotation,Android,Animation,Rotation,我有一个按钮小部件,我有一个成功的旋转动画,但它只是回到原来的位置。我怎样才能让它停下来 以下是我的xml文档: <?xml version="1.0" encoding="UTF-8"?> <rotate xmlns:android="http://schemas.android.com/apk/res/android" android:fromDegrees="0" android:toDegrees="90" android:pivotX=
<?xml version="1.0" encoding="UTF-8"?>
<rotate
xmlns:android="http://schemas.android.com/apk/res/android"
android:fromDegrees="0"
android:toDegrees="90"
android:pivotX="50%"
android:pivotY="50%"
android:repeatCount="0"
android:duration="1200" />
使用
android:fillAfter=“true”
和android:fillEnabled=“true”
检查动画xml规范:
使用
android:fillAfter=“true”
和android:fillEnabled=“true”
检查动画xml规范:
谢谢,太好了,作为一个noob,文档有时会完全混淆。谢谢,太好了,作为一个noob,文档有时会完全混淆
Button tx = (Button)v;
tx.startAnimation(AnimationUtils.loadAnimation(this, R.anim.rotateit));