Quantcast
Channel: React Native FlatList with columns, Last item width - Stack Overflow
Viewing all articles
Browse latest Browse all 20

Answer by Supriya C S for React Native FlatList with columns, Last item width

$
0
0

check whether the number of items is odd, if the number is odd, give a special style to the last item. eg)

 {this.props.count%2!= 0?
                <View style={this.props.entireList.indexOf(item) === this.props.entireList.length-1 ?stles.v1:styles.v2}></View>
 v1:{
 width:'48%'
}
v2:{
}

Viewing all articles
Browse latest Browse all 20


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>