我知道可以使用这样的动画集同时运行一系列动画:
AnimationSet animationSet = new AnimationSet(true);
animationSet.addAnimation(new RotateAnimation(this,0));
/**
* more animation
*/
animationSet.addAnimation(new RotateAnimation(this,90));
animationSet.start();
我想用 viewanimator 实现类似的效果(同时显示一系列 View 的动画):
ViewPropertyAnimator a = v.animate().rotation(0).setDuration(500);
有什么办法可以实现这个目标吗?
最佳答案
If only one or two properties on a View object are being animated, then using an ObjectAnimator is fine.But if several properties are animated simultaneously, or if you just want a more convenient syntax to animate a specific property, then ViewPropertyAnimator might be more well-suited to the task.
view.animate().scaleX(2).scaleY(4).rotation(180).
setDuration(3000).setInterpolator(new
AccelerateDecelerateInterpolator()).start();
关于java - View 的动画集,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48636904/