I found an easy solution, in the popover content controller (what you pass to initWithContentViewController
) add:
- (void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];
self.view.superview.layer.cornerRadius = 0;
}
Question
I am making a custom popover background by subclassing UIPopoverBackgroundView. I want to make popover without rounded corners. I can successfully create background without rounded corners (red in picture), but it seems that UIPopoverController adds some rounded corner mask to the content of the popover (green in picture). Here is the picture of the corner of my popover:
Any ideas how I can overcome it?
Solution
I found an easy solution, in the popover content controller (what you pass to initWithContentViewController
) add:
- (void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];
self.view.superview.layer.cornerRadius = 0;
}
OTHER TIPS
You can do an own PopoverBackgroundView. I have never used UIPopoverBackgroundView, but there's maybe a property for it, but otherwise you can do an own and set the view without rounded corners.
For this you can change green colour to clear colour and then add a UIView on pop over view, with greencolour and add all the other views as its subviews.(This is a tricky way)