RN 之TouchableOpacity组件
constructor(props){ super(props); this.state = { title:'不透明触摸' } this.activiEvent = this.activiEvent.bind(this); } render() { return ( <View> {/* onPress={this.renderPress()} onPress={()=>this.activiEvent('点击')} onPressIn={()=>this.activiEvent('按下')} onPressOut={()=>this.activiEvent('抬起')} onLongPress={()=>this.activiEvent('长按')} */} <View> <TouchableOpacity activeOpacity={0.5} onPress={()=>this.activiEvent('点击')} onPressIn={()=>this.activiEvent('按下')} onPressOut={()=>this.activiEvent('抬起')} onLongPress={()=>this.activiEvent('长按')} > <View> <Text>我是文本但可以点击常用事件</Text> </View> </TouchableOpacity