Component - Parallax scrolling
This UI component creates a parallax scrolling effect where the background image moves slower than the foreground content as you scroll. This gives a sense of depth and a smooth, engaging user experience.
This UI component creates a parallax scrolling effect where the background image moves slower than the foreground content as you scroll. This gives a sense of depth and a smooth, engaging user experience.
View ├─ Animated.ScrollView │ ├─ Animated.Image (background) │ └─ View (content container) │ ├─ Text (title) │ └─ Text (body content)
parallax scrolling in mobile apps?new Animated.Value(initialValue).const scrollY = new Animated.Value(0);
const translateY = scrollY.interpolate({
inputRange: [0, 100],
outputRange: [0, -50],
extrapolate: 'clamp'
});
// Used in style: { transform: [{ translateY }] }const scrollY = new Animated.Value(0);
const translateY = scrollY.interpolate({
inputRange: [0, 100],
outputRange: [0, 50],
extrapolate: 'extend'
});
// Used in style: { transform: [{ translateY }] }Pass the test and this pattern moves unknown