0
我只是想創建一個VideoView對象的淡出效果。 問題:雖然我爲動畫設置了一定的持續時間,但看起來沒有持續時間。該VideoView對象立即消失..Android:AlphaAnimation - 無持續時間
事情我已經嘗試:
AlphaAnimation anim = new AlphaAnimation(1, 0);
anim.setDuration(2000);
anim.setFillAfter(true);
mVideoView.setVisibility(View.VISIBLE);
mVideoView.startAnimation(anim);
第二次嘗試:
Animation anim = AnimationUtils.loadAnimation(this, R.anim.fadeout);
anim.setFillAfter(true);
mVideoView.startAnimation(anim);
in fadeout.xml:
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
>
<alpha
android:fromAlpha="1.0"
android:toAlpha="0.0"
android:duration="2000"
/>
</set>
我會很高興,如果有人可以幫助我在這裏。