Quantcast
Channel: How to use TouchableNativeFeedback in React native android? - Stack Overflow
Viewing all articles
Browse latest Browse all 5

Answer by jsina for How to use TouchableNativeFeedback in React native android?

$
0
0

best practice to use TouchableNativeFeedback.Ripple is to check the api version of devices first, because this background type is available on Android API level 21+.

import { Platform } from 'react-native';

<TouchableNativeFeedback
  onPress={this.follow}
  background={
    Platform.Version >= 21 ?
      TouchableNativeFeedback.Ripple('rgba(0,0,0,.2)', true) :
      TouchableNativeFeedback.SelectableBackground()
  }
>

Viewing all articles
Browse latest Browse all 5

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>