Эй, ребята, я пытаюсь показать модальный щелчок на марке карты, но я не вижу никакого модального на маркерном щелчке, может кто-нибудь помочь мне в этом. Я использую Modal из https://github.com/maxs15/react-native-modalboxМодальные не отображаются в реакции-родной?
Вот код:
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
что вы используете 'extend React.Component' или' React.createClass'? – stereodenis