1
如何在動畫完成後停止動畫?Android java完成後停止動畫
我的動畫圖像變淡
代碼:
的Java:
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
ImageView imageView= (ImageView)findViewById(R.id.tCat);
Animation fadeInAnimation = AnimationUtils.loadAnimation(this, R.anim.anim);
imageView.startAnimation(fadeInAnimation);
XML
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<alpha android:fromAlpha="0.0" android:toAlpha="1.0"
android:interpolator="@android:anim/accelerate_interpolator"
android:duration="5000"
android:repeatCount="infinite"/>
</set>
謝謝! 5分鐘內我的投票最佳答案(當我可以的時候) –
HAHA 4年後,仍然不接受 – bubblebath