【发布时间】:2017-12-25 13:11:54
【问题描述】:
export default class Send extends Component{
constructor(props)
{
super(props);
const ds = new ListView.DataSource({rowHasChanged: (r1, r2) => r1 !== r2});
this.state = {
userDataSource: ds,
isLoading: true,
PickerValueHolder : '',
amount:'',
RxAmount:'',
exchange:'',
input1:'',
recRate:[{},{},{}]
}
}
fetchUsers(){
fetch('https://trs.php?some parameters')
.then((response) => response.json())
.then((response) => {
console.log(response)
this.setState({
userDataSource: this.state.userDataSource.cloneWithRows(response),
});
});
}
renderRow(user , sectionId, rowId, highlightRow,key){
return(
<View style={styles.row}>
<Text style={styles.rowText}> Rate {user[0].Rate}</Text>
</View>
); }
<ListView
dataSource={this.state.userDataSource}
renderRow={this.renderRow.bind(this)}
/>
i want to access the rate highlighted in yellow
我是新手,所以我想访问一组对象并只获得一个以黄色突出显示的特定值,我不知道该怎么做?
谢谢
【问题讨论】:
标签: arrays listview react-native