UISplitViewController - 推动模态视图 [英] UISplitViewController - Pushing Modal View

查看:69
本文介绍了UISplitViewController - 推动模态视图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用UISplitViewController时推送模态视图时最佳做法是什么?你会从RootViewController,DetailViewController或直接从Application Delegate推送吗?

What is considered the best practise when pushing a modal view when using a UISplitViewController? Would you push from the RootViewController, the DetailViewController or directly from the Application Delegate?

理想情况下,我想要实现的功能是尽快显示模态视图控制器UISplitViewController是根据某些条件加载的。

Ideally the functionality I am trying to achieve is to have the modal view controller displayed as soon as the UISplitViewController is loaded based on certain conditions.

提前感谢您对此问题的任何指示。

Thanks in advance for any pointers on this matter.

推荐答案

我试图做同样的事情,我想出了以下答案:从App Delegate做起来更简单。

I was trying to do the exact same thing, and I've come up with the following answer: it's simpler to do it from the App Delegate.

在纵向模式下,RootViewController以奇怪的方式创建(弹出窗口),因此它不实用,Application Delegate确保您的视图在所有情况下都能正确显示。我不记得在DetailViewController中执行它的问题是什么。

In Portrait mode, the RootViewController is created in a strange way (popover) so it's not practical, the Application Delegate ensures your view will show properly in all cases. I can't remember what was the issue with doing it in the DetailViewController though.

编辑:应用程序中的实际实现:didFinishLaunchingWithOptions:是这样的: [splitViewController presentModalViewController:modalViewController animated:NO]; 。希望这有帮助!

the actual implementation in application:didFinishLaunchingWithOptions: is something like that: [splitViewController presentModalViewController: modalViewController animated: NO];. Hope this helps!

这篇关于UISplitViewController - 推动模态视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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