【问题标题】:How do I wrap content vertically in a Horizontal FlatList?如何在水平平面列表中垂直包装内容?
【发布时间】:2020-12-26 16:26:22
【问题描述】:
【问题讨论】:
标签:
react-native
flexbox
expo
【解决方案1】:
你不应该使用 {flex : 1}。以 FlatList 样式设置 {flexGrow : 0}
<View style={{flex:1}}>
<FlatList
data={[{ key: 1345654323 }, { key: 2324565422 }, { key: 334837548 }, { key: 34432 }, { key: 3000223 }, { key: 3333 }]}
renderItem={this._renderItem}
horizontal={true}
style={{backgroundColor:'orange',flexGrow:0}}
/>
<View style={{backgroundColor:'blue',flexGrow:1}}></View>
</View>