Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UIPopoverController, how to change the size of it?

I've got UIPopoverController in my Split-View application, I just need to make popover longer. In viewDidLoad of DetatilViewController I put:

self.popoverController.popoverContentSize=CGSizeMake(320, 1400);

Nothing happens( when should I put this? thanks

Done with that ^^^ How can I set background for Popover? thaanks

like image 834
Vladimir Stazhilov Avatar asked Aug 31 '11 08:08

Vladimir Stazhilov


4 Answers

From iOS 7:

popoverView.contentViewController.preferredContentSize =  CGSizeMake(320, 1400);
like image 174
Mobile Developer Avatar answered Oct 23 '22 07:10

Mobile Developer


Set contentSizeForViewInPopover property of UIPopOverController

like image 30
Hitesh Avatar answered Oct 23 '22 07:10

Hitesh


popView.contentViewController.preferredContentSize = Your Size

This works on iOS 8 but will crash or have no effect on lesser versions

Hope the answer :)

like image 11
Ansari Awais Avatar answered Oct 23 '22 06:10

Ansari Awais


Try overriding -(CGSize)contentSizeForViewInPopover in your view controller, and return the size you want your view controller to be.

like image 6
jklp Avatar answered Oct 23 '22 07:10

jklp