UISplitViewController 不是 rootViewController

发布于 2024-11-30 16:04:10 字数 885 浏览 0 评论 0原文

是的,我知道苹果不想这样做,但我想这样做。

我想使用另一个 UISplitViewController 作为模式视图控制器。

我通过谷歌搜索找到了一些解决方案,

  1. 制作自己的UISplitViewController

    是的!它很简单,有些人已经实现了。

  2. 使用一个UISplitViewController,并更改其viewControllers属性

    viewControllers 属性必须由堆栈管理,就像 UINavigationController 一样。

  3. 创建另一个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,

  1. make your own UISplitViewController

    yes! it's simple and some already implemented it.

  2. use one UISplitViewController, and change its viewControllers property

    viewControllers property have to managed by stack, like UINavigationController does.

  3. make another UIViewController, and assign its view property that is from UISplitViewController

    I made MyViewController, and it has UISplitViewController instance from nib (or code)

    in viewDidLoad in MyViewController:

    self.view = splitViewController.view
    

    and I'm using MyViewController as modal view controller.

    It shows UISplitViewController well, but UISplitViewControllerDelegate doesn't work because it is not root view controller.

any more suggestions, or which way do you recommend, friends?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

删除会话 2024-12-07 16:04:10

我刚刚发现以下内容,这似乎解决了我的主要问题(能够使用分割视图作为导航控制器的子级):

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

望她远 2024-12-07 16:04:10

是的,我知道苹果不想这样做,但我想这样做。

如果不需要,为什么要这么做? :)

如果您仍在寻找更简单的方法,请查看我对此类似线程的回答。

Yes, I know Apple doesn't want to do that, but I want to do.

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..

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文