我有一個補間動畫在Android的問題,我嘗試從屏幕中心移動一個ImageView
項目到屏幕頂部,但在變換結束後ImageView
返回到第一個位置!我使用此代碼:Android:補間動畫:移動ImageView
<?xml version="1.0" encoding="utf-8"?>
<translate
xmlns:android="http://schemas.android.com/apk/res/android"
android:interpolator="@android:anim/bounce_interpolator"
android:fromYDelta="0%"
android:toYDelta="-1500%"
android:duration="3000"
android:startOffset="3000">
</translate>
private void RunAnimations() {
Animation animation = AnimationUtils.loadAnimation(this, R.anim.move_up_maxname);
animation.reset();
ImageView maxName = (ImageView) findViewById(R.id.imageView1);
maxName.clearAnimation();
maxName.startAnimation(animation);
}
任何人都可以幫助我嗎?
謝謝