ios - 在 Storyboard中嵌套 View Controller

标签 ios objective-c viewcontroller

我正在学习如何使用 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中使用它。

enter image description here

有用的教程:Storyboards With Custom Container View Controllers

关于ios - 在 Storyboard中嵌套 View Controller ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22179130/

相关文章:

ios - 根据 iPhone 上的内容设置 webview 的动态高度

ios - 使用侧面菜单更改 Root View Controller

ios - 应用过滤器(AVAudioUnitEQ)后保存音频文件并最终将其保存为mp3?

ios - 如何在不损失质量的情况下将 UIImage 存储在 NSMutableArray 中

ios - 'AppDelegate' 不符合协议(protocol) 'GIDSignInDelegate'

ios - 使用 URL swift Alamofire 上传视频

ios - 获取mapView注解的indexPath

swift - 从 appdelegate 更新 viewcontroller - 最佳实践?

ios - 调用中参数 'sender' 缺少参数

xcode - Swift 2 - 如何将导航 Controller 后退按钮自定义为自定义按钮?