【发布时间】:2017-08-17 22:27:19
【问题描述】:
如果我用图片演示会更好。
这就是我想要达到的目标。假设横向模式平板电脑大小。假设我在数组中有 X 个元素。我想将它映射到整个行,直到它连续有 3 个项目,然后下降。使用引导程序,我可以执行 3 次 col-md-4 之类的操作。
目前我正在使用native-base。它有一个有趣的grid systems,但不是我想要的。
这就是我现在拥有的:
<Grid>
<Row>
{ recipeStore.categories.map((category, index) => {
return (
<Col key={index} style={{height: 300}}>
<Card>
<CardItem>
<Body>
<Text>{ category.name }</Text>
</Body>
</CardItem>
</Card>
</Col>
)
})}
</Row>
</Grid>
如何让数组迭代填充 3 列然后转到下一行?
【问题讨论】:
标签: layout react-native grid