【发布时间】:2018-04-18 17:16:42
【问题描述】:
我知道这方面还有其他主题,但我似乎不知道如何实现它。
我有一个只使用 xib 的应用,没有情节提要。
我有一个包含项目列表的模式,我需要显示另一个包含所选项目详细信息的模式。
发现的错误是Modal Detail正在Modal List下方打开,需要新用户点击
下面的代码打开项目列表
let modalViewController = DependenteListaViewController()
modalViewController.modalPresentationStyle = .overCurrentContext
present(modalViewController, animated: true, completion: nil)
下面的代码打开项目详情
let modalViewController = DetailViewController ()
modalViewController.modalPresentationStyle = .currentContext
present (modalViewController, animated: false, completion: nil)
调用另一个模态的模态的正确方法是什么?
【问题讨论】:
-
当你要使用嵌套模式时:不要。
-
您不能在呈现另一个模态时呈现模态。在
UINavigationController上创建DependenteListaViewController并呈现导航控制器,然后按下DetailViewController。或者关闭第一个模态并呈现下一个。