1
I hope for the help. I create at first for ImageView TranslateAnimation, then as AnimationEnd I register creation of AnimationDrawable in ListenerAnimation and I start it.
ImageView MyImageView = New ImageView(this);
MyImageView.setImageResources(R.drawable.mypic1);
TranslateAnimation tr = New TranslateAnimation(0, 0, 0, 50);
tr.setFillAfter(true);
tr.setDuration(3000);

MyImageView.startanimation(tr); 但我只看到第一枪。然后,如果在那之后我创建并且我将启动任何动画,例如,再次 TranslateAnimation,AnimationDrawable 完全开始。AnimationDrawable ad = New AnimationDrawable(); ad.setOneShot(true); ad.addFrame(getResources().getDrawable(R.drawable.mypic1), 500); ad.addFrame(getResources().getDrawable(R.drawable.mypic2), 500); ad.selectDrawable(0); MyImageView.setImageDrawable(ad); ad.start(); 在 AnimationDrawable 还是 Animation 之后不创建什么?在此先感谢您的帮助。

4

0 回答 0