Animating an Image Using ImageView

I am new to Android programming, and I looked around but couldn't find a clear answer. I need to slowly animate the image by switching it using anothe, like a sprite. If someone can help, it seems like it should be very simple. Thank!

+5
source share
1 answer

You might want to use TransitionDrawable http://developer.android.com/reference/android/graphics/drawable/TransitionDrawable.html

Drawable[] layers = new Drawable[2];
layers[0] = //your first drawable
layers[1] = //your second drawable
TransitionDrawable transition = new TransitionDrawable(layers);
myImageView.setImageDrawable(transition);
transition.startTransition(1500);
+10
source

All Articles