目标是实现与在 iOS 上的“邮件”应用程序中创建新电子邮件完全相同的效果。
当点击邮件应用程序右下角的“撰写”按钮时,当前的 View Controller 在背景中略微淡化,一个新的 View Controller 被部分加载到它的顶部。仍然可以在屏幕顶部看到旧的 View Controller 。单击右上角的“+”按钮时,Fantastical 应用程序也会执行此操作。
最佳答案
您可以将它作为 subview Controller 添加到您当前的 View Controller 中。
// Parent View Controller
//...
let childController = ChildController()
addChildViewController(childController)
// add the child controller's view in, reframe it, animate it here
addSubview(childController.view)
// To remove the controller
childController.removeFromParentViewController()
关于ios - 如何在现有 View Controller 之上部分加载新的 View Controller ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35051371/