反应本机表单元格对齐行



我想根据我得到的数据以不同的方式设置表格的每个单元格的样式。如果我使用 Cell 元素,元素总是创建一个换行符。

如何避免这种情况并在行方向上呈现它?

我使用 react-native-table-component,react-native-paginated-listview

<PaginatedListView
style={{ marginBottom:30}}
renderRow={(data,i) =>
{
this._cellBack = !this._cellBack;
return(
<TouchableOpacity onPress={(e) => this._onPressButton(e,data)}>
<View style={styles.button}>
<Cell key="1" data="1" height={28} style={[styles.tableCell, this._cellBack && {backgroundColor: '#DFF5F2'}]}  textStyle={styles.tableCellText} widthArr={this._widthArr} myProp="10"/>
<Cell key="2" data="2" height={28} style={[styles.tableCell, this._cellBack && {backgroundColor: '#DFF5F2'}]}  textStyle={styles.tableCellText} widthArr={this._widthArr} myProp="10"/>
</View>
</TouchableOpacity>
);
}
}
itemsPerPage={this._LOADLIMIT}
onFetch={::this.onFetch}
autoFetch={false}/>

更改样式可能会帮助您查看style={{flexDireaction:'row'}}

最新更新