【发布时间】:2014-11-14 11:25:48
【问题描述】:
我有一个带有 TabBarController 的弹出窗口。在一个选项卡中有一个 TableViewController 与名称列表。还有一个加号按钮,它有一个模式 segue 到 AddCharacterVC 用于添加新名称。 在 iOS 7 中,我这样做:
AddCharacterViewController *acvc = (AddCharacterViewController *)segue.destinationViewController;
acvc.modalTransitionStyle = UIModalTransitionStyleCoverVertical;
acvc.modalPresentationStyle = UIModalPresentationCurrentContext;// so it does not take full screen in popover
在 AddCharacterVC 中,我将内容大小设置为:
- (void)viewWillAppear:(BOOL)animated {
CGSize size = CGSizeMake(320, 480); // size of view in popover
if (IDIOM == IPAD && [self respondsToSelector:@selector(preferredContentSize)]){
self.preferredContentSize = size;
}
而且效果很好。
但是,在 iOS 8 中,模态视图不会覆盖整个弹出框,使 TabBar 可见。用户可以点击或不点击,反正模态视图不会正常展开。
我试过了:
- 将 acvc.modalPresentationStyle 设置为 UIModalPresentationOverCurrentContext
- 试图将 TabBar 设置为隐藏
- 在情节提要中检查到 TableVC 的边缘在底部栏下延伸,并且模态视图 (AddCharacterVC) 中的底部栏设置为无
都没有结果。
现在我唯一能想到的就是尝试制作 modalPresentationStyleCustom 并使用 UIPresentationController (我现在正在尝试这样做,但我以前没有这样做过)。我错过了什么吗?有没有其他方法可以做到这一点?抱歉,我还不能在这里发布图片。非常感谢!
【问题讨论】:
标签: objective-c ipad ios8 modalviewcontroller popover