React原生android TouchableNativeFeedback在按下时闪烁黑色



当我按住TouchableNativeFeedback时,它的背景闪烁黑色。我把背景道具设置为TouchableNativeFeedback.SelectableBackgroundBorderless()。把它改成TouchableNativeFeedback.SelectableBackground()TouchableNativeFeedback.Ripple('red', false)不会改变任何东西。也许我漏掉了一些构型?是什么导致了这样的结果?我该怎么修理它?

我只是在React Native的文档中尝试了这个例子,它似乎在我的Android模拟器(Genymotion)上正常工作。下面是代码:

renderButton: function() {
  return (
    <TouchableNativeFeedback
        onPress={this._onPressButton}
        background={TouchableNativeFeedback.SelectableBackground()}>
      <View style={{width: 150, height: 100, backgroundColor: 'red'}}>
        <Text style={{margin: 30}}>Button</Text>
      </View>
    </TouchableNativeFeedback>
  );
}

最新更新