Last active
May 4, 2016 01:59
-
-
Save janicduplessis/b79f5f4c9b0883549eef9859057f9f4f to your computer and use it in GitHub Desktop.
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
import React, {Component} from 'react'; | |
import { | |
Animated, | |
Image, | |
ScrollView, | |
StyleSheet, | |
Text, | |
View, | |
} from 'react-native'; | |
export default class ScrollableHeader extends Component { | |
_renderScrollViewContent() { | |
const data = Array.from({length: 30}); | |
return ( | |
<View style={styles.scrollViewContent}> | |
{data.map((_, i) => | |
<View key={i} style={styles.row}> | |
<Text>{i}</Text> | |
</View> | |
)} | |
</View> | |
); | |
} | |
render() { | |
return ( | |
<View style={styles.fill}> | |
<ScrollView | |
style={styles.fill} | |
> | |
{this._renderScrollViewContent()} | |
</ScrollView> | |
</View> | |
); | |
} | |
} | |
const styles = StyleSheet.create({ | |
fill: { | |
flex: 1, | |
}, | |
row: { | |
height: 40, | |
margin: 16, | |
backgroundColor: '#D3D3D3', | |
alignItems: 'center', | |
justifyContent: 'center', | |
}, | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment