嗨我試圖在地圖上顯示標記的點擊模式,但我看不出上標記點擊任何模式任何人可以幫我出什麼問題。我使用的模態,從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