I want darker background dim color for UIPopover
. I know this can be achieved by subclassing UIPopoverBackgroundView
as mentioned here but I am looking for any simpler way to do this.
P.S. I am using Objective C not Swift.
Swift 4
I just came upon the same problem and found a solution similar to jimmyjudas.
In the viewController displayed as a popover:
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
self.presentingViewController?.view.alpha = 0.3
}
override func viewWillDisappear(_ animated: Bool) {
super.viewWillDisappear(animated)
self.presentingViewController?.view.alpha = 1
}
Easiest method is to simply call self.view.alpha = 0.2
before presenting the popover and setting it back to 1.0 when the popover is dismissed.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With