创建一个数组Animated.Value
like
this.heights = [new Animated.Value(10), new Animated.Value(20), new Animated.Value(30)];
然后使用编写动画功能 https://facebook.github.io/react-native/docs/animated#composing-animations根据您的要求运行这些动画
Animated.parallel([
Animated.timing(this.heights[0], { toValue: **, duration: **}),
Animated.timing(this.heights[1], { toValue: **, duration: **}),
Animated.timing(this.heights[2], { toValue: **, duration: **})
]).start()
然后使用this.heights
在渲染器方法中,例如
<Animated.View style={{height: this.heights[0]}}/>
<Animated.View style={{height: this.heights[1]}}/>
<Animated.View style={{height: this.heights[2]}}/>
希望这会有所帮助!