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

use*_*009 1 react-native react-animated

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

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

ajt*_*yng 6

您的配置对象应该读取easingnot ease

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