UISplitViewController 不是 rootViewController
是的,我知道苹果不想这样做,但我想这样做。
我想使用另一个 UISplitViewController
作为模式视图控制器。
我通过谷歌搜索找到了一些解决方案,
制作自己的
UISplitViewController
是的!它很简单,有些人已经实现了。
使用一个
UISplitViewController
,并更改其viewControllers
属性viewControllers
属性必须由堆栈管理,就像 UINavigationController 一样。创建另一个
UIViewController
,并分配来自 UISplitViewController 的视图属性我制作了
MyViewController
,它有来自nib(或代码)的UISplitViewController
实例在
MyViewController
中的viewDidLoad
中:self.view = splitViewController.view
我使用
MyViewController
作为模式视图控制器。它很好地显示了
UISplitViewController
,但是UISplitViewControllerDelegate
不起作用,因为它不是根视图控制器。
各位朋友还有什么建议或者推荐什么方式吗?
Yes, I know Apple doesn't want to do that, but I want to do.
I want to use another UISplitViewController
as modal view controller.
I found some solutions by googling,
make your own
UISplitViewController
yes! it's simple and some already implemented it.
use one
UISplitViewController
, and change itsviewControllers
propertyviewControllers
property have to managed by stack, like UINavigationController does.make another
UIViewController
, and assign its view property that is from UISplitViewControllerI made
MyViewController
, and it hasUISplitViewController
instance from nib (or code)in
viewDidLoad
inMyViewController
:self.view = splitViewController.view
and I'm using
MyViewController
as modal view controller.It shows
UISplitViewController
well, butUISplitViewControllerDelegate
doesn't work because it is not root view controller.
any more suggestions, or which way do you recommend, friends?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我刚刚发现以下内容,这似乎解决了我的主要问题(能够使用分割视图作为导航控制器的子级):
http://www.codeproject.com/Articles/307008/Versatile-programmer-friend-split-view-controlle
I just found the following, which seems to solve my main problem (being able to use a split view as child of a navigation controller):
http://www.codeproject.com/Articles/307008/Versatile-programmer-friendly-split-view-controlle
如果不需要,为什么要这么做? :)
如果您仍在寻找更简单的方法,请查看我对此类似线程的回答。
Why do you want to, if you don't have to? :)
If you are still looking for a simpler approach, please check out my answer on this similar thread..