2012-06-18 126 views
5

我尝试的颜色从在iOS 5. UIPopoverControler改变要做到这一点,我用UIPopoverBackgroundView的子类,我分配给我的酥料饼是这样的:更改UIPopoverController颜色(和后退按钮颜色)

self.popover.popoverBackgroundViewClass = [KWPopoverBackgroundView class]; 

我的popover现在是黑色的,因为我在我的KWPopoverBackgroundView类中定义了,但我仍然遇到外观问题。弹出窗口内导航控制器的后退按钮(奖牌)仍然是蓝色的。我希望一切都以黑色统一。我如何摆脱这种蓝色?

enter image description here

我试图改变我的navigationController.navigationBar的tintColor,但当然酥料饼一点儿也不了解照顾。 有没有办法在iOS 5.0中解决这个问题? (我的应用程序在AppStore上,我不想要一个丑陋的黑客来解决这个问题)谢谢。

+0

在iOS7 – Jacky

回答

12

好吧,我刚刚发现如何更改UIPopoverController内的UINavigationController后退按钮(或其他UIBarButtonItems)的色调颜色。

使用UIPopoverBackgroundView,您只能更改背景和箭头图像。要改变其他项目的外观,你必须使用UIAppearance,如下所示。

// Set the UIBarButtonItem(s) inside UIPopoverController class to dark gray 
[[UIBarButtonItem appearanceWhenContainedIn:[UIPopoverController class], nil] 
         setTintColor:[UIColor colorWithWhite:0.1f alpha:1.0f]]; 

black popover with black back button item

+0

不行我搜索包含多个关键字,正要放弃,找到从谷歌图片搜索使用的图像。奇怪的是,Google图片搜索为我带来了这个美丽的解决方案。谢谢你用这个回答你自己的问题! – acedanger