0
我正在關注this教程,其中包含react-native
中的部分。不過,我希望我的特定部分的元素按列方式分隔,而不是將它們呈現在單獨的行中。我試圖改變flex
的方向,但無法做到這一點。如何在列表視圖中反應原生呈現單行中某一部分的項目?
在我render
功能,我有:
return(
<ListView
dataSource = {this.state.dataSource}
renderRow = {this.renderRow}
renderSectionHeader = {this.renderSectionHeader}
style={styles.listview}
/>
listview
如下:
listView: {
margin: 10,
flexDirection: 'row'
flexWrap: 'wrap'
}
和renderRow
由下式給出:
return (
<View>
<Button onPress={this._setModalVisible.bind(this,true)}>
<Image source={image} style={{width:50,height:60}}/>
</Button>
</View>
);
我要的是所有的要顯示的特定部分的Buttons
單排,但我無法做到。如何完成這項任務?
您可以顯示你試過的代碼? – rmevans9
用代碼更新了我的問題。 –