How to completely colorize UIPopoverPresentationController background color?

后端 未结 2 1456
北海茫月
北海茫月 2020-12-17 15:08

I\'m working with a Day and Night Mode for an app. The problem is, when just setting the background color of a view AND THEN using it as \"presenting as popover\" there are

相关标签:
2条回答
  • 2020-12-17 15:42

    You can set the UIPopoverPresentationController's backgroundColor. If that isn't sufficient, you will have to customize your popover's UIPopoverBackgroundView. This gives you control of the entire popover background, including the little triangle.

    0 讨论(0)
  • 2020-12-17 15:53

    Here is some code to supplement matt's answer.

    popoverController.popoverPresentationController?.backgroundColor = myColor
    

    or

    self.navigationController?.popoverPresentationController?.backgroundColor = myColor
    
    0 讨论(0)
提交回复
热议问题