TouchableNativeFeedback并不总是对我有缺陷。这个特定的代码段:
render() {
const btnStyle = this.props.btnStyle;
return(
<TouchableNativeFeedback background={TouchableNativeFeedback.Ripple('#60b0f4', false)} onPress={this.props.action}>
<View style={btnStyle} /*onPress={this.props.action}*/>
{
this.state.fontLoaded ?
<Text style={[this.props.textStyle, {fontFamily: 'montserrat-regular'}]}>{this.props.text}</Text>
:
<Text style={[this.props.textStyle, {fontFamily: 'sans-serif'}]}>{this.props.text}</Text>
}
</View>
</TouchableNativeFeedback>
);
}
}
一直工作到今天。按钮组件没有响应,应该响应。给定'background = {TouchableNativeFeedback.Ripple('#60b0f4',false)}',就不会发生应有的连锁反应。有帮助吗?