Android - Leave A Time Between ImageButton Animations?
I have 6 ImageButton. I applied the same animation to all of them as below:
Animation anim1 = AnimationUtils.loadAnimation(this, R.anim.wave_scale);
img1.startAnimation(anim1);
img2.startAnimation(anim1);
img3.startAnimation(anim1);
img4.startAnimation(anim1);
im开发者_StackOverflowg5.startAnimation(anim1);
img6.startAnimation(anim1);
Now, I want to hav a free small time between one animation and the other (let's say 200 ms), so that they will not start at the same time. I tried to add this.wait(200)
between each of the startAnimation methods
but this didn't work.
Any solution ?
The temporary solution that I found until now is:
- You need to re-define the same animation for each ImageView. Strange !
- Before you assign it to an ImageView, you will setStartOffset() for your animation by whatever you want.
Wired But works fine !
Thanks.
try this: img1.setStartOffset(700);
This will create a delay of 700 millsec before animation starts
精彩评论