0

enter image description here

I have UIPopoverController

    UINavigationController *navVC = [[[UINavigationController alloc] initWithRootViewController:loginVC] autorelease];

    navVC.modalInPopover = YES;
    navVC.modalPresentationStyle = UIModalPresentationCurrentContext;    


    _popoverLoginVC = [[UIPopoverController alloc] initWithContentViewController:navVC];

And when I present popover

  [self.popoverLoginVC presentPopoverFromRect:centerFrame
                                     inView:self.splitVC.view
                   permittedArrowDirections:0 
                                   animated:YES];

It looks like it is modal (I can't close popover by tapping outside) but other area hadn't dimmed. I have played with modalPresentationStyle with no luck (

Please, advise

Injectios
  • 2,777
  • 1
  • 30
  • 50

4 Answers4

0

It's modal because you're setting it to be modal.

navVC.modalInPopover = YES;

Just delete that and you should be fine if I understand you correctly.

Desdenova
  • 5,326
  • 8
  • 37
  • 45
0

Remove the line

navVC.modalInPopover = YES;

navVC.modalPresentationStyle = UIModalPresentationCurrentContext;

Community
  • 1
  • 1
Hardik Patel
  • 116
  • 2
  • 18
0

A popover isn't meant to (and can't be specified to) dim the 'background' views, even if presented modally.

Snips
  • 6,575
  • 7
  • 40
  • 64
  • In iOS7 they actually do, automatically: "The popover content is layered on top of your existing content and the background is dimmed automatically", from the [reference page](https://developer.apple.com/library/ios/documentation/uikit/reference/UIPopoverController_class/Reference/Reference.html). – Clafou Dec 12 '13 at 17:40
0
permittedArrowDirections:0

This is not a valid value for this parameter and will result in undefined behavior (at least in iOS >= 6). You must specify one of:

UIPopoverArrowDirectionUp = 1UL << 0,
UIPopoverArrowDirectionDown = 1UL << 1,
UIPopoverArrowDirectionLeft = 1UL << 2,
UIPopoverArrowDirectionRight = 1UL << 3,
UIPopoverArrowDirectionAny = UIPopoverArrowDirectionUp | UIPopoverArrowDirectionDown | UIPopoverArrowDirectionLeft | UIPopoverArrowDirectionRight,

Unfortunately, "no arrow" is not a supported option. :(

devios1
  • 36,899
  • 45
  • 162
  • 260