Search code examples
iosuipopovercontrollerios7

How to disable darker transparent effect in UIPopoverController in iOS7?


I use UIPopoverController to popup an view in iPad iOS7 like this:

    if (!self.popover) {
        UIViewController *popupVC = [[UIViewController alloc] init];
        [popupVC.view addSubview:thePopupView];
        popupVC.preferredContentSize = CGSizeMake(240, 140);
        self.popover = [[UIPopoverController alloc] initWithContentViewController:popupVC];
        self.popover.delegate = self;
    }


    [self.popover presentPopoverFromBarButtonItem:barButton permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];

But when popover active, it make screen darker while this effect not affect other views in iOS6.

How to overcome this issue? Thanks!


Solution

  • If you mean the dimming view that is inserted under the popover, there is only one workaround - use a custom popoverBackgroundViewClass.

    It's complicated, but not as complicated as you might think.