Multiple animations on 1 imageview android

后端 未结 5 1850
感动是毒
感动是毒 2021-02-02 10:42

I have 2 animations which are already working, i want to fade my train + tween my train on the same time. If I execute 1 of these lines it works. But if I try to execute both it

5条回答
  •  终归单人心
    2021-02-02 11:20

    Use the AnimationSet class:

    AnimationSet s = new AnimationSet(false);//false means don't share interpolators
    s.addAnimation(traintween);
    s.addAnimation(trainfad);
    mytrain.startAnimation(s);
    

提交回复
热议问题