嗨我试图在地图上显示标记的点击模式,但我看不出上标记点击任何模式任何人可以帮我出什么问题。我使用的模态,从https://github.com/maxs15/react-native-modalboxModal没有显示在react-native?
下面是代码:
import Modal from 'react-native-modalbox'
openModal4(id) {
this.refs.modal4.open();
}
render(){
return(
<View style={style.mainContainer}>
<MapView
ref="map"
showUserLocation={true}
region={this.state.region}
onRegionChange={this.onRegionChange}
onRegionChangeComplete={this.onRegionChangeComplete}
style={styles.map}
rotateEnabled={false}
showsCompass={false}
>
{this.state.markers.map(function(marker){
return(
<MapView.Marker coordinate={marker.latlng} key={marker.id} onPress={this.openModal4} />
);
})}
</MapView>
<View style={{position: 'absolute', width: windowsWidth, height: windowsHeight - 100, alignItems: 'center', justifyContent: 'center'}}>
<Image
source={require('./assets/map-marker.png')}
/>
</View>
<Modal style={[styles.modal, styles.modal4]} position={"bottom"} ref={"modal4"}>
</Modal>
</View>
)
}
任何人可以帮助我吗?提前致谢。
你能显示文件中的所有代码吗? – stereodenis
你可以看看现在@stereodenis – atif
你用什么'延长React.Component'或'React.createClass'? – stereodenis