如何为并行调用中的每个动画提供回调



Start 方法在动画完成后运行回调。 但是,如果我在并行调用中有多个动画,并且每个动画在不同的持续时间内执行,在外部 Animated.Parallel(( 调用上有一个 start(( 调用,如何为其中的每个动画提供单独的回调?

Animated.parallel([
Animated.timing(
this.pos,
{
toValue: { x: 146, y: 10 },
duration: 1500,
easing: Easing.ease
}
),  // I want to run a different callback here
Animated.timing(
this.pos2,
{
toValue: { x: 146, y: 10 },
duration: 2500,
easing: Easing.quad
}
),   //  ...and here
]).start(function () {
// code for execution after both animations are finished.
});

我通过在并行调用中使用序列完成了我想要的。

最新更新