IOOS模态视频传感器背景是黑色的,而不是透明的

问题描述 投票:0回答:0
我正在使用以下代码方式呈现一个uiviewController:

let fileTypePopUP = FileTypePopUP(nibName: "FileTypePopUP", bundle: nil) fileTypePopUP.delegate = self fileTypePopUP.modalPresentationStyle = .fullScreen self.present(fileTypePopUP, animated: true)
Inside Filetypepopup,我的视图具有透明的背景,一个子视图覆盖了屏幕高度的一半。问题在于,全屏模态没有显示背景为透明,而是显示黑色背景。

我尝试了什么:

设置self.view.backgroundColor = .clearinfiletypePopup.

    将示范风格更改为.overfullscreen,但仍然显示为黑色。
  • 确保子视图的背景颜色不会干扰。
  • 预期的结果:
  • 我希望背景是透明的,因此呈现视图控制器在模式下仍然可见。

使用.modalPresentationStyle = .overfullscreen 我在顶部和底部有空间 如此图像

enter image description here

检查呈现的视图的顶部和底部约束(FileTypePopup View)。约束应匹配监督的顶部和底部,而不是SafeArea。 enter image description here

ios swift popup
最新问题
© www.soinside.com 2019 - 2025. All rights reserved.