Search code examples
iosiphoneuipopovercontroller

How to set clearColor for UIPopover View?


I need to set UIPopover background color to clearColor. But rest of all colors are working fine with below code:

myPopover.backgroundColor = [UIColor greenColor];

but when I set clearColor, there is a white background instead of transparent. Can any one help me. Thanks in Advance!


Solution

  • If what you're talking about is a UIPopoverController, then try setting the background color to its content view controller's view.

    myPopover.contentViewController.view.backgroundColor = [UIColor clearColor];

    Also, check this SO post about custom popover backgrounds.