【问题标题】:how can i use four animation one after another我怎样才能一个接一个地使用四个动画
【发布时间】:2011-08-21 15:27:26
【问题描述】:

嗨,我有四个动画,即 anim1、anim2、anim3、anim4。对于动画,我使用的代码为

        RotateAnimation anim1 = new RotateAnimation(240, 120, 8, 70);
        anim1.setRepeatCount(0);
        anim1.setDuration(18000);
        anim1.setFillAfter(true);
        img7.startAnimation(anim1);

我想一个接一个地播放四个动画,即在动画1结束时,动画2必须播放等等......对于前两个动画我正在使用

   setAnimationListener()

它通过将 second(anim2) 作为

来工作
      public void onAnimationEnd(Animation animation) {
        // TODO Auto-generated method stub
        RotateAnimation anim2 = new RotateAnimation(240, 120, 8, 70);
        anim2.setRepeatCount(0);
        anim2.setDuration(18000);
        anim2.setFillAfter(true);
        img7.startAnimation(anim2);
    }

现在我将为动画的其余部分做什么。请一些人帮助我。

【问题讨论】:

    标签: android animation


    【解决方案1】:

    尝试使用动画监听器,

    link

    【讨论】:

    • 感谢您的回复。只需查看上面的代码,监听器正在使用动画,当我使用两个动画时它正在工作。即在这里我使用了两个动​​画 anim1 和 anim2。当 anim1 结束时,anim2 将在这里播放。现在我想在 anim2 的末尾添加另一个 anim3。它是如何可能的?这就是问题......我希望你能得到我
    猜你喜欢
    • 2015-02-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-09-01
    相关资源
    最近更新 更多