Running into some trouble animating rows on the y axis in my ListView. x axis is fine, y axis is a no go.
This is a stripped down version of what I'm doing: Style:
var animateStyle = {transform:[{translateX: this.state.position.x, translateY: this.state.position.y}]}
Animated View:
<Animated.View ref={(row) => main[userId] = row} style={[animateStyle]}>
<TouchableHighlight onPress={() => this._move()}>
<Text>hello</Text>
</TouchableHighlight>
</Animated.View>
The example below sets the x value and moves the row perfectly fine but if you switch out the values to animate on the y axis nothing happens.
_move: function() {
var newValue = this.state.position.x._value+1;
this.state.position.x.setValue(newValue);
var thisUserComponent = this.props.main[this.props.user.id];
thisUserComponent.refs.node.measure((x, y) => {
console.log(x, y);
});
}
Any ideas? It might simply not be possible - which is why I'm here, cheers!