我有這樣一個組成部分:反應本地播放聲音事件
import React, { Component } from 'react'
import { StyleSheet, Text, View, TouchableOpacity } from 'react-native'
class MovieList extends Component {
handlePress() {
// Play some sound here
}
render() {
const { movie } = this.props
return (
<TouchableOpacity onPress={this.handlePress.bind(this)}>
<View style={styles.movie}>
<Text style={styles.name}>{movie.name}</Text>
<View style={styles.start}>
<Text style={styles.text}>Start</Text>
</View>
</View>
</TouchableOpacity>
)
}
}
這裏的時候,我接觸到view
我要玩一些聲音。 我用Google搜索了一下,但沒有找到任何合適的答案
有沒有反正我可以播放聲音時,我按下的東西? 我該怎麼做?
看看https://github.com/zmxv/react-native-sound它正是你需要的。 –