|
1 | 1 | [](https://www.npmjs.com/package/react-native-parallax-scroll-view)
|
2 | 2 |
|
| 3 | +# Rodrigocs - Animated Driver |
| 4 | + |
| 5 | +This component now uses Native Driver by default. |
| 6 | +Remember to pass a Animated component to `renderScrollComponent`, by default it has `Animated.ScrollView` |
| 7 | + |
| 8 | +# Example |
| 9 | +```js |
| 10 | +import ParallaxScrollView from 'react-native-parallax-scroll-view'; |
| 11 | +import CustomScrollView from 'custom-scroll-view' |
| 12 | + |
| 13 | +const AnimatedCustomScrollView = Animated.createAnimatedComponent(CustomScrollView) |
| 14 | + |
| 15 | +render() { |
| 16 | + return ( |
| 17 | + <ParallaxScrollView |
| 18 | + backgroundColor="blue" |
| 19 | + contentBackgroundColor="pink" |
| 20 | + parallaxHeaderHeight={300} |
| 21 | + // renderScrollComponent={() => <Animated.View />} |
| 22 | + renderScrollComponent={() => <AnimatedCustomScrollView />} |
| 23 | + renderForeground={() => ( |
| 24 | + <View style={{ height: 300, flex: 1, alignItems: 'center', justifyContent: 'center' }}> |
| 25 | + <Text>Hello World!</Text> |
| 26 | + </View> |
| 27 | + )}> |
| 28 | + <View style={{ height: 500 }}> |
| 29 | + <Text>Scroll me</Text> |
| 30 | + </View> |
| 31 | + </ParallaxScrollView> |
| 32 | + ); |
| 33 | +} |
| 34 | +``` |
| 35 | + |
3 | 36 | # react-native-parallax-scroll-view
|
4 | 37 |
|
5 | 38 | A `ScrollView`-like component that:
|
@@ -99,7 +132,7 @@ The `ParallaxScrollView` component adds a few additional properties, as describe
|
99 | 132 | - **Breaking:** Removes `ParallaxScrollView#scrollWithoutAnimationTo` since this has been deprecated in React Native. If you used this method previously, use `scrollTo` instead.
|
100 | 133 | - Adds `ParallaxScrollView#getScrollableNode` method, which is required in React Native 0.20.0 for components implementing
|
101 | 134 | `ScrollView` interface.
|
102 |
| - |
| 135 | + |
103 | 136 | See full changelog [here](./CHANGELOG.md).
|
104 | 137 |
|
105 | 138 | ## Contributing
|
|
0 commit comments