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')