简体   繁体   English

将两个容器视图添加到视图控制器

[英]Adding two container views to a view controller

I have added two container views into a stack view but can only see one of the containers contents when i run the simulator. 我已将两个容器视图添加到堆栈视图中,但是运行模拟器时只能看到其中一个容器内容。 Are there any special considerations for attempting this? 尝试此操作有什么特殊考虑吗? Is it possible? 可能吗? Thanks in advance for any help. 在此先感谢您的帮助。

Yes, it's quite possible. 是的,这很有可能。 You have to control-drag from each container view to the child view controller that you want to embed in each, and if you have custom setup code for each you need to put unique segue identifiers on each and write your prepareForSegue method to set up each separately. 您必须控制从每个容器视图拖动到要在每个容器视图中嵌入的子视图控制器,如果您有针对每个容器的自定义安装代码,则需要在每个容器上放置唯一的Segue标识符,并编写prepareForSegue方法来设置每个容器分别。

Post your code and screenshots of your IB setup for more specific help. 发布您的代码和IB设置的屏幕截图以获取更多具体帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM