preferredContentSize不起作用而不是contentSizeForViewInPopover

Ani*_*sad 13 iphone xcode ios7 xcode5

我正在进行项目,我想让我的应用程序与IOS7兼容.

self.contentSizeForViewInPopover = CGSizeMake(90, 1 * 65 - 1);
Run Code Online (Sandbox Code Playgroud)

此方法已从ios7弃用

新方法是 self.preferredContentSize= CGSizeMake(90,1*65-1);

但我没有得到适当的用户界面在此输入图像描述

但是当我使用ios7兼容方法进行更改时,我的观点是这样的

使用ios7方法我得到了这个 在此输入图像描述

Sha*_*rma 7

这在Apple文档中给出:

此属性允许方向操作弹出窗口的内容大小.直接更改属性等同于animated = YES.内容大小限制为最小宽度320和最大宽度600.

@property (nonatomic) CGSize popoverContentSize;

- (void)setPopoverContentSize:(CGSize)size animated:(BOOL)animated;
Run Code Online (Sandbox Code Playgroud)

我已经实现了处理像这样及其工作的popover的内容大小:

self.popController.popoverContentSize = CGSizeMake(430, 460);
Run Code Online (Sandbox Code Playgroud)