android - 如何在 React Native 中指示按下

标签 android react-native

我正在使用 TouchableHighlight。我希望按下该区域以向用户指示反馈,以便他们知道它已被按下。我该怎么做?

<TouchableHighlight onPress={() => (this.navToReport(report))}>
  <View>
    <View style={globalStyles.inspectionsItemContainer}>
      <Text style={styles.secondaryText}>{this.getTime(report)}</Text>
      <Text style={globalStyles.inspectionsItemAddress}>{this.getAddress(report)}</Text>
      <Text style={styles.secondaryText}>{this.getClientName(report)}</Text>
    </View
  </View>
</TouchableHighlight>

最佳答案

您可以设置一个activeOpacity 属性,see the docs for details .或者改为使用 TouchableOpacity

关于android - 如何在 React Native 中指示按下,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42516056/

相关文章:

android - 具有自定义形状的自定义 ImageView

java - 如何从 ble 设备获取正确(解码)的制造商广告数据?

ios - 从头开始 React Native Video 重播

objective-c - 错误: @"Bridge module %@ does not conform to RCTBridgeModule"

button - 如何在 react 原生的按钮上滚动顶部?

android - IntentService 开始新服务 - 在哪个线程上?

android - 连接打印机的api

android - 显示软输入键盘

javascript - React Native类型错误: undefined is not an object (evaluating '_ref.item' )

android - React Native Material 下拉菜单从 json 数据中获取 id