I'm fading out an imageview with alpha animation. I'd like the image to stay transparent after the animation. Tried with 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
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With