带有水平弹簧的React本机动画

时间:2019-07-11 15:18:12

标签: react-native animation react-animated

我正在查看以下项目:https://github.com/sanpyaelin/react-native-collapse-view

复制其CollapseView组件后,我试图将Animated.spring转换为水平扩展/折叠,但是不确定如何进行,或者是否可以使用给定的API。

例如,我尝试将Animated.spring方法参数更改为以下内容:

    Animated.spring(
      new Animated.ValueXY({x: startAnim, y: collapse ? 5 : 100}),
      {
        toValue: new Animated.ValueXY({x: endAnim, y: collapse ? 100 : 5}),
        tension: this.props.tension,
      }
    ).start();

但是没有效果。

任何建议或可行的例子都很好。

0 个答案:

没有答案