我正在使用 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/