iphone - 如何推送 ViewController 并让第一个 Controller 部分可见?

标签 iphone ios cocoa-touch uiview uinavigationcontroller

我有一个基于 UINavigationController 的应用程序。我想实现呈现(推送) View Controller 的效果,同时让前一个 Controller 的一部分可见。所以我想有这样的效果:

enter image description here

理想情况下,第二张图片的底部应该是第一个 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 。

想法是将 PreviousVCContainerUINavigationController 连接起来,以便在 navVC 推送或弹出 vc 时收到通知。然后它会寻找合适的 vc 以显示在底部 View 中,并将此 vc 添加为子 VC。

我希望这能让你开始。如果您需要有关某些特定点的更多详细信息,请告诉我。

关于iphone - 如何推送 ViewController 并让第一个 Controller 部分可见?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13247175/

相关文章:

ios - 当应用程序从后台带到前台时如何制作 UIAlertView

ios - 有没有可能在程序执行的过程中让一个对象一直在前面?

ios - 如何在IOS中调用PUT请求需要传递一个Dictionary

iphone - 如何将 UIScrollView 嵌套在 UIScrollView 中,以便用户可以滚动内部 UIScrollView?

ios - 将自定义颜色设置为 UITabBarItem 不起作用

ios - dismissModalViewControllerAnimated 函数不关闭 View

iphone - 如何优化我的 Controller 以使其加载速度更快?

iphone - 调用 UILocalNotification cancelAllLocalNotifications 是仅取消调用它的应用程序的通知还是所有通知?

ios - 从 NSDictionary 中提取文件

iphone - Xcode上的怪异编译错误