12

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

Mobile Developer
  • 5,730
  • 1
  • 39
  • 45
Vladimir Stazhilov
  • 1,956
  • 4
  • 31
  • 63

5 Answers5

14

From iOS 7:

popoverView.contentViewController.preferredContentSize =  CGSizeMake(320, 1400);
Mobile Developer
  • 5,730
  • 1
  • 39
  • 45
14

Set contentSizeForViewInPopover property of UIPopOverController

Mobile Developer
  • 5,730
  • 1
  • 39
  • 45
Hitesh
  • 1,230
  • 1
  • 10
  • 12
11
popView.contentViewController.preferredContentSize = Your Size

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

Hope the answer :)

Ansari Awais
  • 299
  • 4
  • 14
  • 1
    contentSizeForViewInPopover stopped working after updating to ios 8, and preferredContentSize is working for ios 8. – Murat Oct 24 '14 at 14:40
6

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

jklp
  • 2,091
  • 2
  • 23
  • 37
4

if u want to set the content size of the UIPopoverController try this,

self.popNameList =   [[UIPopoverController alloc]initWithContentViewController:search_table];
self.popNameList.popoverContentSize = CGSizeMake(320, 100);

good luck..

Mobile Developer
  • 5,730
  • 1
  • 39
  • 45
Priyan Haridas
  • 183
  • 2
  • 7