gpt4 book ai didi

java - View 的动画集

转载 作者:太空宇宙 更新时间:2023-11-04 10:43:50 25 4
gpt4 key购买 nike

我知道可以使用这样的动画集同时运行一系列动画:

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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com