translateX: new Animated.Value(0)
opacity: new Animated.Value(0)
Animated.parallel([
Animated.timing(this.state.translateX, {
toValue: -20,
duration: 500
}),
Animated.timing(this.state.opacity, {
toValue: 1,
duration: 500
})
]).start()
或
opacity: new Animated.Value(0)
// for translateX
this.state.opacity.interpolate({
inputRange: [0, 1],
outputRange: [0, -20]
})
在这种情况下如何在插值和并行之间进行选择?还是都可以吗?