我有一个基于 UINavigationController 的应用程序。我想实现呈现(推送) View Controller 的效果,同时让前一个 Controller 的一部分可见。所以我想有这样的效果:
理想情况下,第二张图片的底部应该是第一个 Controller View 的一部分。
这可以使用 UINavigationController 方法完成吗?如果可以,怎么做?
最佳答案
这是可能的,但需要相当多的努力。
在我的头脑中,我会实现一个自定义容器 View Controller ,它有一个 UINavigationController
和另一个自定义容器 View Controller (我们称它为 PreviousVCContainer
)作为 subview Controller 。参见 Creating Custom Container View Controllers . “内部容器 View Controller ”将在底部提供 View ,并将前一个 View Controller (带有“第一个标题”的 View Controller )作为 subview Controller 。
想法是将 PreviousVCContainer
与 UINavigationController
连接起来,以便在 navVC 推送或弹出 vc 时收到通知。然后它会寻找合适的 vc 以显示在底部 View 中,并将此 vc 添加为子 VC。
我希望这能让你开始。如果您需要有关某些特定点的更多详细信息,请告诉我。
关于iphone - 如何推送 ViewController 并让第一个 Controller 部分可见?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13247175/