React native 按钮单击内部详图索引在react native map android中不起作用
caaout内部的可触摸不透明度不起作用。实际上,单击同一调用内的关闭按钮后,我需要隐藏自定义调用视图。不幸的是,我的功能不是在单击关闭按钮时触发 `React native 按钮单击内部详图索引在react native map android中不起作用,react-native,react-native-android,react-native-maps,React Native,React Native Android,React Native Maps,caaout内部的可触摸不透明度不起作用。实际上,单击同一调用内的关闭按钮后,我需要隐藏自定义调用视图。不幸的是,我的功能不是在单击关闭按钮时触发 ` constcloseInforWindow=(e)=>{ console.log(“单击关闭按钮”); } {markers.map((marker,key)=>{ 返回( {marker.name} {closeinforwindow(e)}}> ) })} 你试过使用onPressOut吗?似乎onPress有个漏洞 const close
constcloseInforWindow=(e)=>{
console.log(“单击关闭按钮”);
}
{markers.map((marker,key)=>{
返回(
{marker.name}
{closeinforwindow(e)}}>
)
})}
你试过使用onPressOut吗?似乎onPress有个漏洞
const closeinforwindow=(e)=>{
console.log("close button is clicked");
}
<SafeAreaView style={{flex: 1}}>
<View style={Interfacestyle.container}>
<MapView mapType="satellite" style={Interfacestyle.map} region={getInitialState()}>
{markers.map((marker, key) => {
return(
<Marker
key={key}
coordinate={marker.latlng}
title={marker.title}
description={marker.description}
calloutOffset={{ x: -8, y: 10 }}
calloutAnchor={{ x: 0.5, y: 0.2 }}
>
<Image source={{uri: marker.image}} style={{width: 42, height: 42,transform: [{ rotate : `${marker.heading} deg`}]}}/>
<Callout tooltip >
<View style={[Interfacestyle.info_windowwrapper]}>
<View style={[Interfacestyle.info_windowcontainer]}>
<View style={[Interfacestyle.inforwwindowheader]} >
<View style={{width:"92%",alignItems:'center'}}><Text style={[Interfacestyle.inforwwindowheadertext]}>{marker.name}</Text></View>
<View style={[Interfacestyle.menuicon]}>
<TouchableHighlight onPress={(e)=>{closeinforwindow(e)}}>
<Icon name="close" color="#fff" size={16} />
</TouchableHighlight>
</View>
</View>
</View>
</Callout>
</Marker>
)
})}
</MapView>
<View>
</SafeAreaView