更改UIPopoverView背景+箭头颜色 [英] Change UIPopoverView background + arrow color

查看:581
本文介绍了更改UIPopoverView背景+箭头颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法在iOS8上简单地更改UIPopoverView背景颜色(包括它的箭头)?

Is there a way to simply change the UIPopoverView background color (including its arrow) on iOS8?

(我确实读了一对有关自定义UIPopoverControllers的文章。这是否适用于此,意味着答案是否?)

(I did read a couple of articles on customizing "UIPopoverControllers". Does this apply here too, meaning the answer is "no"?)

这不是我应该能够在 prepareForSegue中解决的问题触发popover的方法?如何才能到达相应视图以更改其外观?

Isn't this something I should be able to address in the prepareForSegue method triggering the popover? How can I reach the according view to change its appearance?

推荐答案

我找到了解决方案。 iOS8不再需要子类化了!可以在tableview - > navigation - > popoverPresentationController

I found the solution. Subclassing is not necessary anymore with iOS8! The background can be accessed and changed like this from within the tableview -> navigation -> popoverPresentationController

    self.navigationController?.popoverPresentationController?.backgroundColor = UIColor.redColor()

在WWDC会话214中有关此内容的更多信息。

More information about this in WWDC session 214.

这篇关于更改UIPopoverView背景+箭头颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆