如何以模态方式将此 ViewController 定位在详细视图上?我希望它正确对齐,以便您可以看到导航部分变灰。
[self.window addSubview:self.splitViewController.view];
MyModalViewController *modalvc= [MyModalViewController new]; //brevity
modalvc.modalInPopover = YES;
modalvc.modalPresentationStyle = UIModalPresentationStylePageSheet;
modalvc.view.autoresizeMask = UIViewAutoresizeFlexibleRightMargin;
[self.splitViewController presentModalView:modalvc animated:NO];
[self.window makeKeyAndVisible];
我还检查了 MyModalViewController 如果我设置了视图掩码而我没有,它也没有从 Nib 获取魔法值。
在当前之前调整框架(使用 modalvc.view.frame)什么也不做。
在现在之后调整框架似乎会产生疯狂的结果,我只需要它在横向上超过一半宽度......纵向是正常行为。
编辑
图片让人们感到困惑,所以我把它拿出来,我不希望模态视图成为屏幕的大小,我想保留它 UIModalPresentationStylePageSheet 但它的 ORIGIN 向右移动,以便它覆盖横向的详细视图部分