Last active
September 20, 2018 00:02
-
-
Save olegbl/71468f3244a3a2af6fcd4ea70efb2123 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
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