Skip to content

Instantly share code, notes, and snippets.

@janicduplessis
Last active May 4, 2016 01:59
Show Gist options
  • Save janicduplessis/b79f5f4c9b0883549eef9859057f9f4f to your computer and use it in GitHub Desktop.
Save janicduplessis/b79f5f4c9b0883549eef9859057f9f4f to your computer and use it in GitHub Desktop.
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