如何反转 Android 中的加速插值器的加速度

发布于 2024-12-28 07:41:56 字数 215 浏览 4 评论 0原文

我在我的应用程序中的 TextView 上使用 2 个动画。

第一个完成,然后我更改 TextView 的文本,然后开始第二个。我想在整个序列上使用加速插值器效果,但是如果我单独应用它,它将不起作用,因为速度将在每个动画上重新启动。

我需要反转第二个动画,即。使其开始快,结束慢。

有什么办法可以做到这一点吗?

谢谢!

I'm using 2 animations on a TextView in my app.

The first one completes, then I change the text of the TextView, then I start the second one. I would like to use an Accelerate Interpolator effect on the whole sequence, however if I apply it individually it doesn't work, since the speed will restart on each animation.

I need to invert the animation of the second one, ie. make it start fast and end slow.

Is there any way to do this?

Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

寒冷纷飞旳雪 2025-01-04 07:41:56

使用DecelerateInterpolator():

一种插值器,其变化率开始时很快,然后减速。

IE

    animation.setInterpolator(new DecelerateInterpolator());
    animation.setDuration(300L);
    v.startAnimation(animation);

use a DecelerateInterpolator():

An interpolator where the rate of change starts out quickly and and then decelerates.

i.e.

    animation.setInterpolator(new DecelerateInterpolator());
    animation.setDuration(300L);
    v.startAnimation(animation);
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文