是否可以让来自 2 个不同故事板的 2 个视图控制器同时在屏幕上处于活动状态? [英] Is it possible to have 2 view controllers from 2 different storyboards to be active on the screen simultaneously?

查看:28
本文介绍了是否可以让来自 2 个不同故事板的 2 个视图控制器同时在屏幕上处于活动状态?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试开发一些与 Uber 应用类似的东西.我必须将 2 个视图控制器保存在单独的故事板中.我需要在具有 scnview 的 View 控制器上拉出像 Uber 一样的抽屉.简单来说,以 Uber 为例,我需要一种方法来完成相同的交互,其中 mapViewController 位于一个故事板中,而具有驱动程序详细信息的抽屉位于另一个故事板中.

I am trying to develop something on the lines of the Uber app. I have to keep the 2 view controllers in separate storyboards. I need to pull up a drawer like in Uber over a View controller which has a scnview. In simpler term and taking Uber as an example, I need a way to accomplish the same interaction where the mapViewController is in one storyboard and the drawer having the driver details to be in another storyboard.

推荐答案

您也可以通过许多其他方式实现此功能,

You can implement this feature in many other ways as well,

但问题的答案是 - 是的,您可以在屏幕上同时显示多个控制器.

But answer to your question is - Yes you can display more than one controller at the same time on screen.

您可以像这样使用 ContainerView :

You can use ContainerView like this :

并且使用 Storyboard 引用,您可以包含另一个故事板控制器的 UIViewController.

And using Storyboard reference, you can contain UIViewController of another storyboard's controller.

这篇关于是否可以让来自 2 个不同故事板的 2 个视图控制器同时在屏幕上处于活动状态?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆