通过分割视图控制器使用多个详细视图
如您所知,UISplitViewController
只有一个根控制器和一个详细视图控制器,但我想使用另一个详细视图控制器。
当我从根控制器(弹出窗口控制器)中选择列表项时,选择应该触发不同的详细信息视图 - 即,row1 触发详细信息视图1,row2 触发详细信息视图2,按钮项触发详细信息视图3,等等。 我怎样才能实现这个目标?
As you know, a UISplitViewController
has one root controller and one detail view controller only, but I want to use another detail view controller.
When I select the list items from the root controller (popover controller), the selection should fire different detail views -- i.e., row1 fires detail view1, row2 fires detail view2 and a button item fires detail view3, etc.
How can I achieve this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
Apple 的这个项目是 2012 年的,没有使用故事板。如果您正在寻找非故事板解决方案,它会很好地工作,但在 Xcode 6 中您应该利用故事板中新的“显示详细信息”segue。
这是一个快速示例项目,它展示了如何通过使用 Show 在同一分割视图上使用多个详细信息视图控制器来自主视图控制器的详细信息。
That project from Apple is from 2012 and doesn't use storyboards. If you are looking for a non-storyboarded solution, it will work fine but in Xcode 6 you should be taking advantage of the new Show Detail segue in storyboards.
Here's a quick example project that shows how to use multiple detail view controllers on the same split view by using the Show Detail segue from the Master View Controller.
Apple 有一个项目可以满足您的需求。 MultipleDetailView
There's a project from Apple that covers exactly what you need. MultipleDetailViews
在斯威夫特
In Swift
我知道这是一篇迟到的帖子,因为这是 6 年前提出的问题,并且是去年活跃的。
但是有一种方法可以为分割视图控制器提供多个详细视图。
通过将每个细节控制器嵌入到其自己的导航控制器中,并使用“显示细节”segue 从主视图链接到每个控制器,您可以通过使用关联的标识符然后从主视图功能来实现视图之间切换的结果didSelectRowAt' 选择一行,您可以在其中选择您希望查看的详细信息视图。
I know this is a late post as this was asked 6 years ago and active last year.
But there is a way to have multiple detail views for a split view controller.
By embedding each detail controller into its own navigation controller and linking from the master view to each using the 'show detail' segue, you are able to achieve this result of switching between views by using an identifier associated and then from the master view function 'didSelectRowAt' selecting a row is where you can select which detail view you wish to see.