UISplitViewController可以作为UINavigationController中的根控制器吗? [英] Can a UISplitViewController be the root controller in a UINavigationController?

查看:72
本文介绍了UISplitViewController可以作为UINavigationController中的根控制器吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

接口构建器不允许您将UISplitViewController添加为UINavigationController的根控制器. 我还尝试以编程方式创建UINavigationController并将其根视图控制器设置为UISplitViewController.

Interface builder does not allow you to add a UISplitViewController as the root controller of a UINavigationController. I've also tried programmatically creating the UINavigationController and setting its root view controller to be the UISplitViewController.

结果是一个只有导航栏的空窗口.

The result is an empty window with just the nav bar.

我还尝试了替换拆分视图控制器MGSplitViewController.除了拆分视图控制器中的主视图是另一个UINavigationController外,它通常都可以工作.它的导航栏显示得太粗.更改方向并向后清除即可.

I've also tried a split view controller replacement, MGSplitViewController. It mostly works, except that within the split view controller, the master view is another UINavigationController. Its nav bar shows up too thick. Changing orientation and back clears it up.

我一直在尝试各种不同的方法来使视图看起来像是拆分视图和我在其他视图之间切换的视图.我已经在选项卡视图控制器中尝试过,编写了自己的控制器来管理窗口的子视图,并将拆分视图作为托管视图,现在是导航控制器.所有尝试都有一些问题.最一致的问题是关于视图的方向.我的应用程序以横向模式运行,通常子视图认为它仍然是静态肖像.

I've been trying all sorts of different approaches to having a view that looks like a split view and other views that I switch between. I've tried within a tab view controller, writing my own controller to manage subviews of the window and having the split view as a managed view, and now the navigation controller. All attempts have had some issues. The most consistent issue is regarding the orientation of the view. My app is running in landscape mode and typically the child views think its still portrait.

任何想法表示赞赏.

推荐答案

否.

最重要的是:UISplitViewController必须是应用程序(或可能更确切地说是窗口)的根视图.它不能存在于UINavigationController或其他任何内容中.

The bottom line: a UISplitViewController must be the root view of an app (or perhaps more specifically, a window). It can not live inside a UINavigationController or anything else.

当前的SDK就是这种情况,并且不能保证将来的SDK会改变.

This is the case with the current SDK, and there's no guarantee that will change in future SDKs.

这篇关于UISplitViewController可以作为UINavigationController中的根控制器吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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