I am using a UIPopoverController
to display a UIView
. The layout is somewhat similar to a UISplitViewController
so it is very strange
The black gradient color frame with rounded corner is default for UIPopoverController. However you can use a custom class to set the background view . Here try following link.
change color navigation controller in a popover
For anyone who uses UIPopoverPresentationController
, the following should work.
override open func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
view.superview?.layer.cornerRadius = 0
}
There is no supported way to make the view inside of your UIPopoverController not have rounded corners. The internal code of the UIPopoverController adds your view to a view with rounded corners that clips to bounds.
There may be a hackish way to do it, i.e. waiting until the UIPopoverController is shown and then traversing through all of the parent's of your view and setting them all to have cornerRadius = 0;
and clipsToBounds = NO;
, but even if you find a solution it might not be compatible with all versions of iOS and if Apple changes some internal code of UIPopoverController in the future then your solution could break.
If you really want to do this then the best way to go is to create your own class that mimics the UIPopoverController functionality.