系统升级到ios 13后,发现使用 presentViewController可能会造成要present的vc地底部被遮挡,如图:


解决方法就是将vc的modalPresentationStyle设置成UIModalPresentationFullScreen即可。
imagePickerVc.modalPresentationStyle = UIModalPresentationFullScreen
相关属性值有:
UIModalPresentationFullScreen :全屏显示(默认)
UIModalPresentationPageSheet 宽度:竖屏时的宽度(768) 高度:当前屏幕的高度(填充整个高度)
UIModalPresentationFormSheet :占据屏幕中间的一小块(比较常用)
UIModalPresentationCurrentContext :跟随父控制器的呈现样式
网友评论