To style an Alert element in React Native, we set the Modal
‘s style
prop.
For instance, we write
<Modal style={{ background: "red" }} ref={"modal1"}>
<Text style={{ color: "white" }}>Basic modal</Text>
<Button onPress={this.toggleSwipeToClose} style={styles.btn}>
Disable swipeToClose({this.state.swipeToClose ? "true" : "false"})
</Button>
</Modal>
to set the style
prop of the Modal
to { background: "red" }
to make the background red.
And we set the Text
style by setting the Text
‘s style
prop to { color: "white" }
.
And we set the Button
‘s style to styles.btn