我有这样一个组成部分:反应本地播放声音事件
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它正是你需要的。 –