我在获取列表视图的值然后发送它们时遇到问题。
这是一个评级系统(RatingBar),我想获得每个项目的名称和评级。
谢谢
<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>
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句