Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/swift/19.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在Swift中更改iOS popover中箭头的背景色?_Swift_Xcode_Uiview_Storyboard_Popover - Fatal编程技术网

如何在Swift中更改iOS popover中箭头的背景色?

如何在Swift中更改iOS popover中箭头的背景色?,swift,xcode,uiview,storyboard,popover,Swift,Xcode,Uiview,Storyboard,Popover,当我将情节提要中UIView的背景色设置为特定颜色(例如黑色)时,弹出窗口的箭头保持不变(例如白色) 如何更改箭头的颜色?如果希望看到与Popor背景颜色相同颜色的Popor箭头,请在UIViewController的“viewDidLoad()”方法(“Popop”)中添加以下行: 如果self.popoverPresentationController?.backgroundColor不起作用,您可能需要尝试访问该窗口。如果您将该行包含到UIViewController中,并将其用作popo

当我将情节提要中UIView的背景色设置为特定颜色(例如黑色)时,弹出窗口的箭头保持不变(例如白色)


如何更改箭头的颜色?

如果希望看到与Popor背景颜色相同颜色的Popor箭头,请在UIViewController的“viewDidLoad()”方法(“Popop”)中添加以下行:


如果
self.popoverPresentationController?.backgroundColor
不起作用,您可能需要尝试访问该窗口。如果您将该行包含到UIViewController中,并将其用作popover的内容,则该窗口会起作用
 override func viewDidLoad() {
    super.viewDidLoad()

    self.popoverPresentationController?.backgroundColor = self.view.backgroundColor
}