AnimationDrawable animation = new AnimationDrawable();
animation.addFrame(getResources().getDrawable(R.drawable.image1), 100);
animation.addFrame(getResources().getDrawable(R.drawable.image2), 100);
animation.addFrame(getResources().getDrawable(R.drawable.image3), 100);
animation.setOneShot(false);
ImageView imageAnim = (ImageView) findViewById(R.id.img);
imageAnim.setBackgroundDrawable(animation);
// start the animation!
animation.start()
Monday, April 29, 2013
Android-Animate Images Cyclically
To Animate Images cyclically for an image view create an animation drawable
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment