CASpringAnimation receives damping, stiffness, and mass directly. On Android, SpringAnimation derives its damping ratio from these values using: dampingRatio = damping / (2 * sqrt(stiffness * mass)).
Parameters
Parameter intuition
dampingcontrols how quickly oscillation dies out. A low damping value (e.g.8) produces noticeable bounce; a high value (e.g.20) reaches the target without overshoot.stiffnesscontrols the speed of the animation. Higher stiffness means the spring pulls harder and the animation completes faster.massadds inertia. Heavier objects take longer to accelerate and decelerate, producing a weighty feel.
Spring Presets
These presets cover the most common animation feels:Example
Spring animations do not support the
loop option. Use a timing animation with loop: 'repeat' or loop: 'reverse' for looping effects.On Android, the damping ratio passed to
SpringAnimation is derived from damping, stiffness, and mass using the formula damping / (2 * sqrt(stiffness * mass)). The three parameters are not passed to Android directly, but the resulting motion closely matches iOS for typical values.