Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
谁能告诉我这两种方法getAnimatedValue()和getAnimatedFraction()在 android 中使用的区别ValueAnimator?
getAnimatedValue()
getAnimatedFraction()
ValueAnimator
您是说 getAnimatedValue() 和 getAnimatedFraction() 吗?
getAnimatedValue() 返回您正在制作动画的变量的当前值。
getAnimatedFraction() 返回用于动画的值(它基本上总是从 0.0 到 1.0,它的线性度由插值器设置)。AnimationValue 是通过乘法来确定的。
假设您想在 10 秒内从 0 线性动画到 100。在第 9 秒,animatedFraction 为 0.9f,animatedValue 为 100*0.9f = 90。