gpt4 book ai didi

ios - 使用我的尺寸在窗口中打开模态 ViewController

转载 作者:搜寻专家 更新时间:2023-11-01 06:14:24 32 4
gpt4 key购买 nike

如何使用我的尺寸在窗口中打开模态 ViewController?

我尝试使用它,但它不起作用

modalViewController?.view.superview?.frame = CGRect(x:162, y: 333, width: 700,height: 700)
//
modalViewController?.view.superview?.center = self.view.center

代码:

let modalViewController = self.storyboard?.instantiateViewController(withIdentifier: "Clipboard") as? ClipboardViewController
modalViewController?.modalPresentationStyle = .overCurrentContext
self.present(modalViewController!, animated: true, completion: nil)

示例:

enter image description here

最佳答案

尝试:

let modalViewController = self.storyboard?.instantiateViewController(withIdentifier: "Clipboard") as? ClipboardViewController
modalViewController?.modalPresentationStyle = .formSheet
self.present(modalViewController!, animated: true, completion: nil)
modalViewController!.preferredContentSize = CGSize(width: 700, height: 700)

关于ios - 使用我的尺寸在窗口中打开模态 ViewController,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48156360/

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com