我使用的是TabView,在每个标签页中我都使用flatList。每个列表项都有电话和电子邮件按钮。但是TouchableOpacity onpress不能工作,所以我使用onPressOut。onPressOut正在工作,但它在我接触时有效,而不是在接触时有效。你们知道为什么会这样吗?
<View style={styles.ButtonGroup}>
<TouchableOpacity
style={[styles.ButtonCont, {backgroundColor: '#BEF7D1'}]}
onPressOut={() => {
Linking.openURL(`tel:+90${data.item.kiraci_gsm1}`);
}}>
<Icon
name={'phone'}
type="font-awesome-5"
size={24}
color="#036122"
/>
</TouchableOpacity>
<TouchableOpacity
style={[styles.ButtonCont, {backgroundColor: '#C6E1FF'}]}
onPressOut={() => {
Linking.openURL(`mailto:${data.item.kiraci_eposta1}`);
}}>
<Icon
name={'envelope'}
type="font-awesome"
size={24}
color="#0050AC"
/>
</TouchableOpacity>
</View>

发布于 2021-10-12 09:12:21
注意从哪里导入你的"TouchableOpacity“。当我在安卓平台上把"TouchableOpacity“从”react-native-gesture handler“改为"react-native”的时候。
https://stackoverflow.com/questions/69537851
复制相似问题