1
Ich bin Neuling zu reagieren native Entwicklung. Ich möchte die modale Komponente beim Drücken außerhalb des modalen Reaktivats schließen. Unten ist mein Code.So schließen Sie das Modal in der Reaktion native
state = {
visibleModal : false,
};
_hideModal(){
this.setState({
visibleModal: true,
})
}
render(){
return(
<View style={
[styles.container,
{backgroundColor: this.state.visibleModal ? 'rgba(47, 60, 73, 0.75)': 'white'}
]}>
<Text>Text Behind Modal</Text>
{ this._renderButton('BUTTON',() => this.setState({ visibleModal: true})) }
<TouchableWithoutFeedback onPress={() => {this._hideModal()}}>
<Modal animationType={"slide"}
transparent={true}
visible={this.state.visibleModal}>
<View style={styles.modalContent}>
<Row />
</View>
</Modal>
</TouchableWithoutFeedback>
</View>
);
}
}
Nein, die schließen prop auf ios @JigarShah – HSBP
Sie haben nicht angegeben, dass nicht funktionieren; Fehler) –
My .. sorry @ JigarShah – HSBP