在我使用XCode创建的应用中,我创建了一个视图,该视图作为模式弹出窗口打开。我使用了这段代码:
@IBAction func open_view(_ sender: Any) {
let storyBoard: UIStoryboard = UIStoryboard(name: "Main", bundle: nil)
let VC_test_object = storyBoard.instantiateViewController(withIdentifier: "VC_Test")
VC_test_object.modalPresentationStyle = .popover;
self.present(VC_test_object, animated: true, completion: nil)
}
VC_Test是情节提要中的ViewController。结果是:
但是,我想管理视图的高度以创建某种菜单。如本示例屏幕截图所示(来自“文档”应用):
我不知道该怎么做。
您能告诉我如何管理弹出窗口的高度吗?
感谢您的帮助。
对于您自己的代码版本,此SO链接及其下面的答案是您需要的:Present modal view controller in half size parent controller
但是,我宁愿使用此第三方库:Presentr