2014-08-29 75 views

回答

0

如果您的應用程序在iOS版本< 7上運行,使用contentSizeForViewInPopover

// Inside your view controller 
- (CGSize)contentSizeForViewInPopover 
{ 
    return CGSizeMake(450, 250); 
} 
+0

這已經過時了。使用'preferredContentSize',或從popover中使用'setContentSize:' – Logan 2014-08-29 13:44:36

+0

謝謝。但我怎麼用這個?在我的UIPopoverControllerDelegate中沒有方法「contentSizeForViewInPopover」。我知道如果我手動調用它,我可以使用setContentSize,但是有沒有辦法將它設置爲IB中的Popover? – derdida 2014-08-29 13:51:10

+0

@derdida - 你可以將它添加到彈出窗口中顯示的視圖控制器中。這就是說,它已被棄用,所以其他解決方案可能會更好。 – Logan 2014-08-29 13:59:22