【问题标题】:Delaying animation延迟动画
【发布时间】:2015-08-05 11:38:12
【问题描述】:

我要做的是点击按钮,激活 3 TranslateAnimation

case R.id.button18Holes:

        //*********************************//
        //***LAUNCHES ACTUAL APPLICATION***//
        //*********************************//
        TranslateAnimation slide = new TranslateAnimation(0, -500, 0,0 );
        slide.setDuration(1000);   
        slide.setFillAfter(true);
        buttonHelp.startAnimation(slide); <-- first
        button9Holes.startAnimation(slide); <-- should start slightly after first
        button18Holes.startAnimation(slide); <-- should start slightly after second

//This should wait until all animations are complete
        Intent myIntent = new Intent(src.getContext(), EasyPar.class);
        startActivityForResult(myIntent, 0);

        break;

不确定如何获得将按钮一个接一个地滑离屏幕的效果。

【问题讨论】:

    标签: android translate-animation


    【解决方案1】:

    您可以尝试使用 getTransformation(..) 在设定的时间后运行动画,或者尝试通过轮询前面动画的 hasEnded() 方法等待每个动画结束。

    【讨论】:

    • 谢谢!没看到那些:)
    猜你喜欢
    • 2012-05-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多