Slide 5
Slide 5 text
state = {
fade: new Animated.Value(0)
};
1. Create value
2. Hook it up as a view attribute
Animated.timing(
this.state.fade,
{
toValue: 1,
}
).start();
3. Animate value
4. Or attach it to an event
5. Combine/process values
const fade = Animated.multiply(
this.state.factor,
this.state.scrollY.interpolate({
inputRange: [0, 300],
outputRange: [1, 0]
})
);
{
const yoffset = event.nativeEvent.contentOffset.y;
this.state.scrollX.setValue(yoffset);
}}
>
Animated