使用React v0.31。我实现的Swipeable列表视图没有autoclosing,它在源代码中公布。有谁知道如何解决这个问题?
由于
_renderQuickActionButtons: function(rowData, sectionID, rowID) {
return (<View style={{flex: 1, flexDirection: 'row', }}>
<View style={{flex:1}} />
<View style={{width: 100, backgroundColor: 'blue'}}/>
</View>);
},
<SwipeableListView
scrollEnabled={this.state.scrollEnabled}
style={{backgroundColor: '#2c2e39'}}
dataSource={this.state.ds}
renderRow={this._renderRow}
maxSwipeDistance={100}
renderQuickActions={this._renderQuickActionButtons}
renderSeparator={(s1,r1,_) => <View key={r1} style={{flex: 1, height: 6, backgroundColor: '#2c2e39',}} />}
答案 0 :(得分:0)
来自SwipeableListView类
<SwipeableListView ....>
isOpen={rowData.id === this.props.dataSource.getOpenRowID()}
</SwipeableListView>
打开/关闭行的条件或(Autoclose行)基于id,因此请确保您传递的数组中包含 id 字段