我在视图中使用模式 - 它包含一个表单。表单比视口长 - 因此,内容占据了页面的高度并滚动到视图之外。
谁能建议动态高度的最佳方法?
目前我正在使用以下方法,但如果手机方向切换则不起作用,我确定必须有更好的解决方案?
heightScreen = () => {
return Dimensions.get('window').height - 150;
}
<Modal
isVisible={this.props.showModal}
animationInTiming={500}
backdropColor={'#f79431'}
style={{ marginVertical:50, maxHeight: this.heightScreen()}}
>