[英]react native horizontal list view with no scroll. How to wrap item?
我正在顯示列表中的項目。 我不想使用水平滾動視圖,但如何包裝項目以使它們不會掉出屏幕? 就像我們在android中有FlowLayout一樣。 圖為第一行第三項在屏幕外的一半
<List horizontal={true}
scrollEnabled={false}
style={{flexWrap: "wrap"}}
dataArray={articleData.Types}
renderRow={(Type) =>
<ListItem style={{borderBottomWidth: 0}} content>
<Button rounded>
<Text>{Type.Name}</Text>
</Button>
</ListItem>
}>
</List>
可以使用視圖來實現這一點:
<View style={styles.wrapContainer}>
{DATA.map(data => {
return (
<View style={styles.buttonContainer} >
<Button title={data.name}/>
</View>
)})
}
</View>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.