K
K
KnightForce2018-03-27 22:27:11
React Native
KnightForce, 2018-03-27 22:27:11

Drag'n'Drop React Native not using position?

I often see code like this.

onPanResponderMove: Animated.event([
          null, {dx: this._animatedValue.x, dy: this._animatedValue.y}
        ]), // Creates a function to handle the movement and set offsets
        onPanResponderRelease: () => {
          this._animatedValue.flattenOffset(); // Flatten the offset so it resets the default positioning
        }

But why don't they change left , top , but the offset?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question