我正在学习如何使用 Storyboard进行 iOS 开发,但我似乎无法弄清楚如何在同一屏幕上管理多个 View 。
我希望能够在同一屏幕上控制多个元素,例如 UITableView
旁边有一个 UIImageView
。
这意味着我需要 3 个 UIViewControllers
,1 个用于 UITableView
,1 个用于 UIImageView
,还有一个用于主视图。但据我所知, Storyboard只允许每个 View 层次结构屏幕使用 1 个 Controller 。谁能告诉我我错过了什么?
最佳答案
View Controller Containment 是必经之路。查看 Apple 关于它的文档:
Creating Custom Container View Controllers
Container view controllers are a critical part of iOS app design. They allow you to decompose your app into smaller and simpler parts, each controlled by a view controller dedicated to that task. Containers allow these view controllers to work together to present a seamless interface.
您也可以通过使用容器 View 在 Storyboard中使用它。
关于ios - 在 Storyboard中嵌套 View Controller ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22179130/