Slide 16
Slide 16 text
COLLAPSABLE HEADERS
const yOffset = new Animated.Value(0)
const scale = yOffset.interpolate({
inputRange: [-IMG_HEIGHT, 0, 1],
outputRange: [2, 1, 1],
})
const translateY = yOffset.interpolate({
inputRange: [-2, 0, IMG_HEIGHT - NAVBAR_HEIGHT, IMG_HEIGHT],
outputRange: [-1, 0, 0, NAVBAR_HEIGHT],
})
animatedHeaderStyles = {
transform: [{ translateY }, { scale }]
}
onScrollHandler = Animated.event(
[{ nativeEvent: { contentOffset: { y: yOffset } } }],
{ useNativeDriver: true }
)
...