开发者

Android alpha animation: Staying in last animation frame when animation is completed

I'm fading out an imageview with alpha animation. I'd like the image to stay transparent after the animation. Tried with开发者_JS百科 different combinations of fillAfter and fillEnabled, no luck. How can this be achieved?

pom


setting fillEnabled and fillAfter to true always works for me.

anim = new AlphaAnimation(0.3f, 1.0f);
anim.setDuration(500);
anim.setFillEnabled(true);
anim.setFillAfter(true);
<view>.startAnimation(anim);


Add an Animation.AnimationListener to the Animation via setAnimationListener(). In onAnimationEnd() of the listener, call setVisibility(View.INVISIBLE) on the ImageView.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜