How to completely colorize UIPopoverPresentationCo

2019-01-25 05:09发布

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 little white artifacts (see the picture)

Is there an easy way to fix this? Do I may have to write my own UIView?

enter image description here

2条回答
叼着烟拽天下
2楼-- · 2019-01-25 05:50

Here is some code to supplement matt's answer.

popoverController.popoverPresentationController?.backgroundColor = myColor

or

self.navigationController?.popoverPresentationController?.backgroundColor = myColor
查看更多
等我变得足够好
3楼-- · 2019-01-25 06:15

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.

查看更多
登录 后发表回答