【发布时间】:2013-10-30 10:55:28
【问题描述】:
我正在尝试在 Android 中应用淡入\淡出过渡。
你能告诉我为什么我只看到褪色片刻,然后又恢复到原始 alpha 吗?
我已添加setFillAfter(true); 以保持图像消失。
我试过了:
animation = android.view.animation.AnimationUtils
.loadAnimation(AppService.getAppContext(),
com.waze.R.anim.fade_out);
animation.setInterpolator(new AccelerateInterpolator());
animation.setFillAfter(true);
boxImage_left.startAnimation(animation);
用这个:
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:fillAfter="true">
<alpha android:fromAlpha="0.0"
android:toAlpha="1.0"
android:repeatCount="0"
android:duration="500"/>
</set>
还有:
AlphaAnimation alpha = new AlphaAnimation(0,1);
alpha.setDuration(600);
animation.setInterpolator(new AccelerateInterpolator());
animation.setFillAfter(true);
vImage_left.startAnimation(alpha);
【问题讨论】:
标签: java android xml eclipse animation