从列表视图中获取值发送React-Native
答
<ListView>
renderRow={(rowData, sec, i) =>
(
// you can use button or any other click event here
<TouchableHighlight
activeOpacity={75/100}
underlayColor={'rgb(210,210,210)'}
onPress={() => {
// You can get value like:
rowData.name
// Set them in a state to use anywhere or pass to function from here itself. set state example
this.setState({
name: rowData.name,
})
}}
>
</TouchableHighlight>
)
</ListView>
欢迎堆栈溢出。如果您想要更好的答案,您可能需要添加代码 –