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

Answer by Amit for React Native FlatList with columns, Last item width

$
0
0

@Emilius Mfuruki suggestion is good.But if have text with varying length it doesn't work perfectly.

Thenconst {height, width} = Dimensions.get('window');const itemWidth = (width - (MarginFromTheSide * 2 + MarginInBetween * (n-1))) / n;

Use this width inside your view.

In FlatList use columnWrapperStyle={{ flex: 1, justifyContent: 'space-evenly', }}

Works perfectly.


Viewing all articles
Browse latest Browse all 20

Trending Articles



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