简体   繁体   English

仅在UISplitViewController的DetailViewController中呈现视图控制器

[英]Presenting a View controller only in the DetailViewController of UISplitViewController

I am working with UISplitViewController, and I want to present a VC from the detail view controller of the splitViewController. 我正在使用UISplitViewController,并且我想从splitViewController的详细视图控制器中呈现一个VC。 I do it like this: 我这样做是这样的:

[self presentModalViewController:VC animated:YES]; 

also tried this from master VC. 也从主VC那里尝试过。

[self.detailVC presentModalViewController:VC animated:YES]; 

It comes for the full screen I mean it is like presenting from the UISplitViewController itself. 它用于全屏显示,我的意思是就像从UISplitViewController本身呈现一样。 I tried changing the modal presentation styles even though I got the same results. 即使我得到了相同的结果,我仍然尝试更改模式表示样式。

What I want is the VC that is presented should be presented within the bounds of the DetailVC and it can be of DetailVC's entire frame, but not come anywhere near to the MasterVC. 我要提供的VC应该出现在DetailVC的范围内,并且可以是DetailVC的整个框架,但不能接近MasterVC。

For now I am using UIView Animation to achieve this, any ideas on how to do this just by presenting? 现在,我正在使用UIView Animation来实现这一目标,关于如何通过演示实现此目标的任何想法?

As of Xcode 6: 从Xcode 6开始:

In the storyboard, select the present modally segue, and go to the Identity Inspector, and choose Current Context for the Presentation option. 在情节提要中,选择当前的模式选择,然后转到Identity Inspector,然后为“演示”选项选择“当前上下文”。

在此处输入图片说明

您的详细视图控制器应该在导航控制器内部,然后将其他视图控制器推入导航控制器,而不是模态地。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM