Sep 28, 2020
0
Level 8
React Native: is tit possible to "snap" a FlatList scroll items
I want to use a FlatList component as a Picker, in order to give it that feel I want the vertical items to "snap" each one, this is not like yur typical scrolling behaviour, I don't know how to explain better and I'm not sure this is possible at all but I'd like to hear from other seasoned developers.
<FlatList decelerationRate={"fast"} data={modalPickerStore.pickerData} keyExtractor = { (item, index) => item.title+index.toString() } renderItem={({ item }) =>
<TouchableHighlight onPress={ ()=>{ modalPickerStore.setSelectedPickerData(item.value) } } style={{ width:'100%', height:50, flexDirection:'column', alignItems:'center', justifyContent:'space-between;' }}>
<Icon name={item.icon} size={30} color="black"/>
<Text style={{ color:'rgb(255,52,89)', textAlign:'center' , fontSize:16, fontWeight:'bold' }}>{ item.title }</Text>
<Text style={{ color:'rgb(255,52,89)', textAlign:'center' , fontSize:16, fontWeight:'bold' }}>Hecho</Text>
</TouchableHighlight>}
/>
Please or to participate in this conversation.