React Native Animated - 如何禁用默认缓动?

时间:2018-02-25 00:41:39

标签: react-native react-animated

如何删除应用于Animated.timing函数的默认缓动(easeInOut)?出于某种原因,设置ease: Easing.linear不会删除默认的easeInOut计时。

Animated.timing(this.state.positionX, {
    toValue: 1,
    duration:1000,
    ease: Easing.linear,
    useNativeDriver: true,
}),

1 个答案:

答案 0 :(得分:3)

您的配置对象应该是easing而不是ease

Animated.timing(this.state.positionX, {
          toValue: 1,
          duration: 1000,
          easing: Easing.linear,
          useNativeDriver: true
});