0

I am having trouble with setting the size and position of a UIPopOver without an arrow. What i am trying to do is to bring up a popover view on the top left of the iPad screen and also have the content size that i have set.

I get different content size for the popover when i use an arrow and when i not. When i use the following code:

    CGRect rec = CGRectMake(0, 0, 1, 1);
    [self.displayOpPopover presentPopoverFromRect:rec inView:self.view permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];

The result is:

with arrow

and when i do: [self.displayOpPopover presentPopoverFromRect:rec inView:self.view permittedArrowDirections:0 animated:YES];

The result is :

without arrow

I have set 'use explicit size' for popovers in the storyboard (which is the size of the view when i have an arrow). But the view somehow resizes itself when the arrow direction is 0.

Any suggestions as to how should i set the popover to the top left without an arrow.

Thanks !

R3D3vil
  • 681
  • 1
  • 9
  • 22
  • This looks like a bug to me. I tried what you did and also tried setting either the frame of the content controller's view (self.pop.contentViewController.view.frame = CGRectMake(0, 0, 300, 500)) or setting the popover content size (self.pop.popoverContentSize = CGSizeMake(300, 500)), and neither of them worked either. – rdelmar Dec 03 '12 at 18:08
  • see this it may help you [http://stackoverflow.com/questions/11338316/present-uipopovercontroller-in-same-position-with-changing-just-arrow-offset][1] [1]: http://stackoverflow.com/questions/11338316/present-uipopovercontroller-in-same-position-with-changing-just-arrow-offset – iOS developer May 01 '13 at 08:03

0 Answers0