c# - 是否可以在 iOS 应用程序的导航 Controller 中实现 Split View Controller ?

标签 c# ios ipad xamarin

我正在使用 Xamarin 开发我的第一个真正的 iPad 应用程序,我正在尝试弄清楚是否有一种方法可以从 Split View Controller 中的 Detail View 导航到另一个 View Controller。 Master 和 Detail View 都是表,我希望在 Detail View 上单击一行以离开 Split View 并进入单个 View Controller ,而不仅仅是 Detail View (我已经能够做到)。我没有找到太多关于这个主题的信息,所以我想知道这是否不是一种在 iOS 中处理导航的可行或建议的方式。

代码看起来像下面的代码(使用 Xamarin - C#),但如果我能让导航 Controller 为整个 Split View工作,我认为行点击必须在 SearchSplitViewController 中处理,而不是在细节 View Controller ?如果我将详细 View Controller 放在导航 Controller 中,它会导航到下一页,但主视图仍在左侧。

应用委托(delegate):

UINavigationController rootNavigationController = new UINavigationController();    

SearchSplitViewController split = new SearchSplitViewController();

rootNavigationController.PushViewController(split, false);

this.window.RootViewController = new rootNavigationController;

点击行时从 SplitView Detail 调用的代码:

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

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

最佳答案

这在技术上可能是可行的,但它违反了 Apples guidelines并可能导致您的应用被拒绝。

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.

关于c# - 是否可以在 iOS 应用程序的导航 Controller 中实现 Split View Controller ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23014348/

相关文章:

c# - 在不影响原始对象的情况下修改字典中的项目

ios - locationInView 忽略方向

ios - UIView 从下到上的动画问题

iphone - 访问 OCUnit 测试目标内的 UIImage

ios - Swift UICollectionView iPad 流布局不起作用

c# - Environment.SpecialFolder.ApplicationData 返回错误的文件夹

c# - 为什么 System.Web.Hosting.ApplicationHost.CreateApplicationHost 抛出 System.IO.FileNotFoundException?

ios - 如何在 Realm Swift 中重新排序 UITableView 单元格?

html - 仅限 iPad 的 CSS + 桌面 CSS 冲突?

java - 我如何将这个c#代码翻译成java