2017-04-04 43 views
0

我有一個問題,得到一個列表視圖的值,然後發送它們。從列表視圖中獲取值發送React-Native

這是一個評級系統(RatingBar),我想獲得每個項目的名稱和評級。

感謝

+0

歡迎堆棧溢出。如果您想要更好的答案,您可能需要添加代碼 –

回答

0
<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>