gpt4 book ai didi

ios - 具有超越标签栏的透明背景的 Swift 模态视图 Controller

转载 作者:行者123 更新时间:2023-11-28 10:43:18 24 4
gpt4 key购买 nike

我在要点中尝试了相同的代码:https://gist.github.com/barbietunnie/e5547f35180436ac102cac52a15f8ca3

func showModal() {
let modalViewController = ModalViewController()
modalViewController.modalPresentationStyle = .OverCurrentContext
presentViewController(modalViewController, animated: true, completion: nil)
}

class ModalViewController: UIViewController {
override func viewDidLoad() {
view.backgroundColor = UIColor.clearColor()
view.opaque = false
}
}

它工作正常,但在标签栏的情况下,内容超出了标签栏,我们如何使内容在标签栏的上部/前面可见?<​​/p>

最佳答案

它通过 vc.modalPresentationStyle = .overFullScreen 工作

关于ios - 具有超越标签栏的透明背景的 Swift 模态视图 Controller ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49548970/

24 4 0