我想将多个<View>
s 的高度存储在一个数组中,并将所有这些值一起设置动画。像这样的东西:
<Animated.View style={{height: this.state.heights[0]}}/>
<Animated.View style={{height: this.state.heights[1]}}/>
<Animated.View style={{height: this.state.heights[2]}}/>
但是,当我尝试这样做时:
this.state = {
heights: new Animated.Value([10, 20, 30])
}
这不起作用。
有小费吗?