iPad SplitViewController 的使用 - 已经有分割视图后不允许推送 SplitViewController 的设计理念是什么?
由于我刚刚开始开发 iPad 应用程序 &已经开始习惯 UISplitViewController(在 Storyboard 中)。我遇到的直接问题是,当我尝试从一个 splitViewController 跳转到另一个 splitViewController 时,我收到错误,并收到诸如以下错误:
- “拆分视图控制器无法推送到导航控制器”和
- “应用程序试图呈现一个拆分视图控制器模式”。
希望能得到一些关于在这里布局 iPad 应用程序方面的反馈 - 我的想法(可能是有缺陷的)如下:拥有一个应用程序,其中(a)用户可以选择的视图列表,(b)视图项目列表特定视图,将它们称为“项目”,以及 (c)“项目详细信息”。全部都是 TableViews... 将具有以下概念:
- (a)第一个 SplitViewController - 在左侧有 ViewList,在右侧有 Items,以及
- (b)第二个 SplitViewController - 在左侧有 ItemsList,在 信息
- 因此,您会看到,如果在 (a) 上单击右侧窗格中的某个项目,这将触发用户,然后看到一个新的总体视图,其中 (b) 项目位于左侧,其中突出显示了按下的项目和详细 对于此项目右边的。如果您知道我的意思,则可以有效地将视图向左滑动...
通过将新的 SplitViewController 推到现有的视图上似乎不可能?我正在思考的问题是:
- a) 我的上述要求概念对于 iPad 应用程序来说可以吗?如果不是,你会怎么做?
- b) 如果是,您将如何实施这些?您是否必须坚持使用相同的 splitViewController 并以编程方式交换分配给它的 tableViewController,在这种情况下,您使用我在 XCode 4.2 中使用的 Storyboard 方法会失去页面流的可读性?
As I'm just starting to develop an iPad application & have started getting used to UISplitViewController (within Storyboard). The immediate issue I'm hitting is that I'm getting errors as I try to jump from one splitViewController to another, and getting errors such as:
- "Split View Controllers cannot be pushed to a Navigation Controller " and
- "Application tried to present a Split View Controllers modall".
Would appreciate some feedback in terms of laying out an iPad app here - my thinking (which perhaps is flawed) was as follows: Have an app with (a) list of views the user can select, (b) list of view items for a particular view, call them Items, and (c) Item Details. All are TableViews... Was going to have the concept of:
- (a) 1st SplitViewController - has ViewList on left hand side and Items on right hand side, and
- (b) 2nd SplitViewController- has ItemsList on left hand side and Item Details on right hand side
- So you see if on (a) you click on an Item in the right hand pane, this would trigger the user then seeing a new overall view with (b) Items on the left, with the one pressed highlighted and the details for this item on the right. Effectively sliding the views across one to the left if you know what I mean...
This doesn't seem to be possible via pushing a new SplitViewController onto an existing one? Questions I am pondering are:
- a) Is my requirements concept above ok for an iPad app? If not how would you do this?
- b) If yes, how would you implement these? Do you have to stick with the same splitViewController and programmatically swap out the tableViewControllers allocated to it, in which case you kind of lose the readability of the page flow using the Storyboard approach I'm using in XCode 4.2?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
首先,根据 iOS 指南,SplitViewController 应该是应用程序的根视图控制器。因此,从法律上讲,您不能在导航控制器上推送拆分视图控制器。
但是,您可以根据您的要求设计自己的 splitview 尝试以下链接
此链接可能会有所帮助
https://github.com /grgcombs/IntelligentSplitViewController
https://github.com/SlavaBushtruk/APSplitViewController
或
https://github .com/mattgemmell/MGSplitViewController
First of all, according to iOS guidelines a SplitViewController should be the root view controller of application. So legally you cannot push split View Controller on navigation controller.
However, you can design your own splitview according to your requirement try following links
This link might be helpful
https://github.com/grgcombs/IntelligentSplitViewController
https://github.com/SlavaBushtruk/APSplitViewController
OR
https://github.com/mattgemmell/MGSplitViewController