Skip to content

Instantly share code, notes, and snippets.

@olegbl
Last active September 20, 2018 00:02
Show Gist options
  • Save olegbl/71468f3244a3a2af6fcd4ea70efb2123 to your computer and use it in GitHub Desktop.
Save olegbl/71468f3244a3a2af6fcd4ea70efb2123 to your computer and use it in GitHub Desktop.
const width = Dimensions.get('window').width - 100;
return (
<View
style={{
paddingHorizontal: 50,
overflow: 'hidden',
backgroundColor: 'white',
}}>
<ScrollView
style={{width, height: '100%', overflow: 'visible'}}
horizontal={true}
decelerationRate="fast"
pagingEnabled={true}>
<View
style={{
width,
height: '100%',
backgroundColor: 'red',
}}
/>
<View
style={{
width,
height: '100%',
backgroundColor: 'orange',
}}
/>
<View
style={{
width,
height: '100%',
backgroundColor: 'yellow',
}}
/>
<View
style={{
width,
height: '100%',
backgroundColor: 'green',
}}
/>
<View
style={{
width,
height: '100%',
backgroundColor: 'cyan',
}}
/>
<View
style={{
width,
height: '100%',
backgroundColor: 'blue',
}}
/>
<View
style={{
width,
height: '100%',
backgroundColor: 'purple',
}}
/>
</ScrollView>
</View>
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment