使用分割视图控制器的多个详细视图 [英] Using Multiple Detail Views with Split View Controller

查看:242
本文介绍了使用分割视图控制器的多个详细视图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如你所知, UISplitViewController 只有一个根控制器和一个详细视图控制器,但我想使用另一个详细视图控制器。

As you know, a UISplitViewController has one root controller and one detail view controller only, but I want to use another detail view controller.

当我从根控制器(popover控制器)中选择列表项时,选择应该触发不同的细节视图 - 例如row1触发细节view1,row2触发细节view2,按钮项触发细节view3
我如何实现这个?

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?

推荐答案

有一个来自苹果的项目, MultipleDetailViews

There's a project from Apple that covers exactly what you need. MultipleDetailViews


此示例演示如何使用UISplitViewController来管理
多个详细视图。

This sample shows how you can use UISplitViewController to manage multiple detail views.

应用程序使用分割视图控制器表视图
控制器作为根视图控制器。当您在
表格视图中做出选择时,将创建一个新的视图控制器并将其设置为拆分
视图控制器的第二个视图控制器。

The application uses a split view controller with a table view controller as the root view controller. When you make a selection in the table view, a new view controller is created and set as the split view controller's second view controller.

根视图控制器定义一个协议
(SubstitutableDetailViewController),细节视图控制器必须
采用。协议指定隐藏和显示控制弹出框的bar按钮
的方法。

The root view controller defines a protocol (SubstitutableDetailViewController) that detail view controllers must adopt. The protocol specifies methods to hide and show the bar button item controlling the popover.

这篇关于使用分割视图控制器的多个详细视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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