In this blog post, I would like to explain how to give Fade In and Fade Out effects to an image in Android.
In a few steps, we can give Fade In and Fade Out effects to an image in Android.
Create ImageView in Xml Layout.
Now, Include the following code:
AlphaAnimation anim = new AlphaAnimation(1.0f, 0.0f);
An animation that controls the alpha level of an object. Useful for fading things in and out.This animation ends up changing the alpha property of a Transformation.
Amount of time (in milliseconds) for the animation to run.
Defines how many times the animation should repeat.
Defines the animation behavior when it reaches the end and the repeat count is greater than 0 or infinite.
Hope this blog post was helpful. Do let me know your feedback.
Latest posts by Nithya Govind (see all)