나는 picView.startAnimation(anim);
과 picView.startAnimation(anim2);
을 가졌지 만 picView.startAnimation(anim2);
만 작동합니다.여러 개의 안드로이드 애니메이션이 동시에 작동하지 않습니다.
두 번째 애니메이션을 제거하면 picView.startAnimation(anim);
만 작동합니다.
두 애니메이션을 동시에 실행하고 싶습니다. 무엇이 잘못 되었습니까?
코드 나는 당신이 AnimationSet
을 만들 필요가
public class PicView extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.pic_view);
LinearLayout myLL = (LinearLayout) findViewById(R.id.LinearLayout2);
final ImageView picView = new ImageView(this);
myLL.addView(picView);
final TextView tv = new TextView(this);
myLL.addView(tv);
Animation anim = AnimationUtils.loadAnimation(PicView.this, R.anim.anim_button);
Animation anim2 = AnimationUtils.loadAnimation(PicView.this, R.anim.anim_button2);
picView.setImageResource(R.drawable.a0000);
picView.startAnimation(anim);
picView.startAnimation(anim2);
}
}
오브젝트하는 애니메이션을하려고? –