Created
April 9, 2020 15:21
-
-
Save anthonyk1225/1e9f4949050cdd2fdd7762189da1d63e to your computer and use it in GitHub Desktop.
example of ParallaxScrollView
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
stickyHeader = () => ( | |
<View><Text>My Sticky Header</Text></View> | |
) | |
<ParallaxScrollView | |
parallaxHeaderHeight={700} | |
renderStickyHeader={this.stickyHeader} | |
stickyHeaderHeight={50} | |
renderForeground={() => ( | |
<Fragment> | |
{/* Everything that goes before sticky header appears */} | |
<View style={{ width: '100%', height: 100, backgroundColor: 'red' }} /> | |
</Fragment> | |
)} | |
> | |
<View style={{ width: '100%', height: 100, backgroundColor: 'blue' }} /> // Everything that goes underneath the sticky header | |
</ParallaxScrollView> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment