我有picView.startAnimation(anim);
和picView.startAnimation(anim2);
,但只有picView.startAnimation(anim2);
有效。多个android动画不能同时运行
当我删除第二个动画只有picView.startAnimation(anim);
作品。
我希望两个动画都能同时运行,我做错了什么?
的代码我有
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);
}
}
其对象是你想动画? – 2014-12-13 13:50:20