从列表视图中获取要发送的值 React-Native

丹尼·布扎

我在获取列表视图的值然后发送它们时遇到问题。

这是一个评级系统(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] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章