React-Native Table单元格对齐行

时间:2017-08-01 12:01:22

标签: react-native

我希望根据我获得的数据对表格中的每个单元格进行不同的设置。如果我使用Cell元素,则Element始终创建换行符。

如何避免这种情况并沿行方向渲染?

我使用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}/>

1 个答案:

答案 0 :(得分:1)

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