[英]React Native, Flatlist customize with 2 item per row
You have to use the numColumns prop of the flat list which would display the items in columns您必须使用平面列表的 numColumns 道具来显示列中的项目
https://reactnative.dev/docs/flatlist#numcolumns https://reactnative.dev/docs/flatlist#numcolumns
You can provide extra property numColumns={2}
in your Flatlist component to get two items each row.您可以在 Flatlist 组件中提供额外的属性
numColumns={2}
以每行获取两个项目。
here is a wonderful tutorial by Spencer: https://www.reactnativeschool.com/react-native-flatlist-grid这是 Spencer 的精彩教程: https : //www.reactnativeschool.com/react-native-flatlist-grid
<FlatList
numColumns={2}
....................
/>
Render your data and make numColumns={2}
呈现您的数据并使
numColumns={2}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.