是否可以在iOS应用程序的导航控制器中实现拆分视图控制器? [英] Is it possible to implement a Split View Controller within a Navigation Controller in an iOS app?

查看:131
本文介绍了是否可以在iOS应用程序的导航控制器中实现拆分视图控制器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Xamarin开发我的第一个真正的iPad应用程序,我正在试图找出是否有办法从拆分视图控制器中的详细信息视图导航到另一个视图控制器。主视图和详细视图都是表格,我想在详细信息视图上单击一行以远离拆分视图并导航到单个视图控制器,而不仅仅是详细信息视图(我已经能够做到)。我在这个主题上找不到多少,所以我想知道这不是一种可行的或建议的在iOS中处理导航的方法。

I'm working on my first real iPad app using Xamarin, and I'm trying to figure out if there's a way to navigate from the Detail view in a Split View Controller to another View Controller. The Master and Detail views are both tables, and I would like a row click on the Detail view to navigate away from the Split View and into a single view controller, not just the Detail view (which I've been able to do). I haven't found much on this topic, so I'm wondering if this is not a viable or suggested way of handling navigation in iOS.

代码看起来像什么喜欢下面的内容(使用Xamarin - C#),但如果我可以让导航控制器适用于整个拆分视图,我认为行搜索必须在SearchSplitViewController中而不是在Detail View Controller上处理?如果我将详细视图控制器放在导航控制器中,它会导航到下一页,但主视图仍在左侧。

The code would look something like what's below (using Xamarin - C#), but if I can get the Navigation Controller working for the whole Split View, I'm thinking the row click would have to be handled in SearchSplitViewController instead of on the Detail View Controller? If I place the Detail View Controller in a Navigation Controller, it navigates to the next page, but the Master View is still on the left.

AppDelegate:

AppDelegate:

UINavigationController rootNavigationController = new UINavigationController();    

SearchSplitViewController split = new SearchSplitViewController();

rootNavigationController.PushViewController(split, false);

this.window.RootViewController = new rootNavigationController;

在行单击时从SplitView详细信息调用的代码:

Code called from SplitView Detail on row click:

MyViewController vc = new MyViewController(id);
this.NavigationController.PushViewController (vc , true);

非常感谢任何建议或示例代码(C#或Objective-C)。
谢谢!

Any suggestions or sample code (C# or Objective-C) are greatly appreciated. Thanks!

推荐答案

这可能在技术上可行,但它违反了苹果指南可能会导致您的应用程序将被拒绝。

It may be technically possible, but it violates Apples guidelines and may cause your app to be rejected.


拆分视图控制器必须始终是
创建的任何接口的根。换句话说,您必须始终从
UISplitViewController对象安装视图作为应用程序的
窗口的根视图。然后,拆分视图界面的窗格可能包含
导航控制器,标签栏控制器或实现界面所需的任何其他类型的视图
控制器。拆分视图
控制器无法以模态显示。

A split view controller must always be the root of any interface you create. In other words, you must always install the view from a UISplitViewController object as the root view of your application’s window. The panes of your split view interface may then contain navigation controllers, tab bar controllers, or any other type of view controller you need to implement your interface. Split view controllers cannot be presented modally.

这篇关于是否可以在iOS应用程序的导航控制器中实现拆分视图控制器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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