繁体   English   中英

Android-更改滚动动画作为加速减速

[英]Android-Change scroll animation as acceleration deceleration

我已经实现了listView。 当我以编程方式滚动时,它的滚动动画非常快。 我想让滚动动画加速,然后以我提供的最大速度(和/或持续时间)减速。

您可以使用此库: https : //github.com/daimajia/AnimationEasingFunctions

例如:

    AnimatorSet animation = new AnimatorSet();
    animation.playTogether(Glider.glide(Skill.CubicEaseInOut, 500f, ObjectAnimator.ofInt(listView, "scrollY", itemView.getTop())));
    animation.setDuration(500);
    animation.start();

其中Skill.CubicEaseInOuthttp://easings.net/对应的动画类型

我希望这有帮助

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM