I want to update the style of the ListView item when I click this item so that the end user knows that he has selected the item.
Listview
<ListView
dataSource={this.state.dataSource}
renderRow={this.renderFriend}
/>
String Renderer:
renderFriend(friend) {
return (
<TouchableHighlight onPress={ ??? }>
<View style={styles.friendItem}>
<View style={styles.profilePictureContainerNoBorder}>
<Image
source={{uri: 'https://graph.facebook.com/' + friend.id + '/picture?width=500&height=500'}}
style={styles.profilePicture}
/>
</View>
<Text style={styles.profileName}>{friend.name}</Text>
</View>
</TouchableHighlight>
);
}
How can I change the style of the second view when the user activates TouchableHighlight?
I would also like to add the selected object to an array of selected objects.
source
share