2013-02-21 87 views

回答

15

以下是使用ObjectAnimator完成它的一种简单方法。如果你想要这个工作前的蜂窝,您可以使用相同的语法,并用view animation做到这一点,或使用NineOldAndroids.

ObjectAnimator animY = ObjectAnimator.ofFloat(button, "translationY", -100f, 0f); 
animY.setDuration(1000);//1sec 
animY.setInterpolator(new BounceInterpolator()); 
animY.setRepeatCount(numRepeats); 
animY.start(); 
+0

我们怎能这个动画添加到多个按钮。?其实按钮一个接一个地掉下来。? – 2015-01-06 14:55:36

+0

感谢分享真的很好,工作正常 – Sam 2016-10-05 20:09:06