我无法使用100属性配置模式高度和宽度.有没有其他方法来设置模态高度和宽度?
<Modal style={{height: 300, width: 300}}
visible={this.state.isVisible}
onRequestClose={this.closeModal}>
</Modal>
上面的代码不起作用.
我无法使用100属性配置模式高度和宽度.有没有其他方法来设置模态高度和宽度?
<Modal style={{height: 300, width: 300}}
visible={this.state.isVisible}
onRequestClose={this.closeModal}>
</Modal>
上面的代码不起作用.
根据Modal份文件,没有要设置的style
props .
您可以try 在<Modal>
中设置<View>
个尺寸:
<Modal transparent={true}
visible={this.state.isVisible}
onRequestClose={this.closeModal}>
<View style={{
flex: 1,
flexDirection: 'column',
justifyContent: 'center',
alignItems: 'center'}}>
<View style={{
width: 300,
height: 300}}>
...
</View>
</View>
</Modal>