简体   繁体   English

如何从UIPopoverController呈现模式视图?

[英]How to present modal view from UIPopoverController?

I have this: 我有这个:

在此处输入图片说明

And have this, when presenting modally: 并在模态呈现时具有以下功能:

在此处输入图片说明

Some code jsut before presenting webview: 呈现网页视图之前的一些代码jsut:

webViewController.modalInPopover = YES;
webViewController.modalPresentationStyle = UIModalTransitionStyleCoverVertical;

And have this in webViewController's viewDidLoad template: 并将其放在webViewController的viewDidLoad模板中:

self.contentSizeForViewInPopover = CGSizeMake(320.0, 436.0);

I've looked for every frame of every role playing view, but frame.sizes are correct. 我一直在寻找每个角色扮演视图的每个框架,但是frame.sizes是正确的。 Anybody with similar experience with a solution for that? 有类似经验的解决方案的人吗?

First I assigned a transistion style to presentation style. 首先,我将横断样式分配给表示样式。 And that was the enum for fullscreen. 那就是全屏的枚举。

Having this in webViewController init... 在webViewController中初始化...

self.modalTransitionStyle = UIModalTransitionStyleCoverVertical;
self.modalPresentationStyle = UIModalPresentationCurrentContext;

...solved the problem. ...解决了这个问题。

I'll try to move it to -(void)awakeFromNib; 我将尝试将其移动到-(void)awakeFromNib; to get rid of hardcoded size. 摆脱硬编码的大小。

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

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