私は地図のマーカーをクリックしてモーダルを表示しようとしていますが、私はマーカーのクリックでモーダルを見ることができません誰でも問題を教えてください。私はここで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
あなたは 'React.Component'や' React.createClass'を使って何を見ているのですか?@stereodenis – atif
? – stereodenis