0
我使用react-native-grid-view
节点模块中列出我的项目获取问题与TouchableOpacity,因为我写了如下代码:在“反应本地网视”
showPlayer(item) {
Alert.alert("Sample", "showPlayer");
}
renderItem(item) {
return <TouchableOpacity style={{alignItems:"center"}} onPress={this.showPlayer.bind(this, item)}>
<ImageLoad
placeholderSource = {require('../images/PlaceHolder.png')}
style={styles.thumbnail}
isShowActivity = {false}
source={{uri: thumbnailObj.value}}
/>
<Text style={styles.gridText}> {item.name}</Text>
</TouchableOpacity>
}
上面的代码我得到这个错误:
undefined is not an object (evaluating 'this.showPlayer.bind')