React Native TouchableNativeFeedback.Ripple(color:'',boolean)在Android v6.0.1上不起作用

时间:2018-07-18 16:32:15

标签: javascript android react-native react-native-android

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)}',就不会发生应有的连锁反应。有帮助吗?

0 个答案:

没有答案