Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ssl/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
React native 按钮单击内部详图索引在react native map android中不起作用_React Native_React Native Android_React Native Maps - Fatal编程技术网

React native 按钮单击内部详图索引在react native map android中不起作用

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

caaout内部的可触摸不透明度不起作用。实际上,单击同一调用内的关闭按钮后,我需要隐藏自定义调用视图。不幸的是,我的功能不是在单击关闭按钮时触发

`

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