I am new to react-native and I am trying to give custom height to modal and to be centered in the screen using the following code.
<Modal visible={this.state.isModalVisible} animationType = "slide" transparent = {false}
onRequestClose={this.closeModal} style={{ height:300 }}>
<View style={{
flex: 1,
flexDirection: 'column',
justifyContent: 'center',
alignItems: 'center',
backgroundColor:'blue'
}}>
<View>
<Text style={{ fontWeight:'bold', fontSize: 20, color: '#f79334', marginTop: 15
}} > Services </Text>
</View>
</View>
</Modal>
Set your height to the content View
instead
<Modal style={{ margin: 0, alignItems: 'center', justifyContent: 'center' }}>
<View
style={{
height: 400,
width: '100%',
justifyContent: 'center',
alignItems: 'center',
backgroundColor: 'blue',
}}
>
<View>
<Text
style={{
fontWeight: 'bold',
fontSize: 20,
color: '#f79334',
marginTop: 15,
}}
>
Services
</Text>
</View>
</View>
</Modal>