在React Native中如何在插值和并行之间进行选择?

时间:2018-10-28 03:36:05

标签: javascript react-native

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]
})

在这种情况下如何在插值和并行之间进行选择?还是都可以吗?

0 个答案:

没有答案