I use horizontal FlatList of React native and use ListItem and Card of Native base in it to render my List Items. It works but the space between items is too big and I can't reduce it.
this is FlatList :
<FlatList
horizontal data={this.props.data}
showsHorizontalScrollIndicator={false}
keyExtractor={item => item.title}
renderItem={this.renderItem}
/>
and this is renderItem:
renderItem = ({ item }) => {
return (
<ListItem onPress={() =>
this.props.navigate(this.state.navigateTO,{
id:item['id'],
title:item['title'],
top_image:item['top_image'],
token:this.state.token,
lan:this.state.lan,
type:this.state.type,
}
)} >
<Card style={{height:320, width: 200}}>
<CardItem cardBody>
<Image source={{uri:item['top_image']}}
style={{height:200, width: 200}}/>
</CardItem>
<CardItem>
<Left>
<Body>
<Text >{item['title']}</Text>
<Text note>{item['city']} </Text>
</Body>
</Left>
</CardItem>
</Card>
</ListItem>
);
};
ItemSeparatorComponent
and passing it as FlatList prop? – Milore