Lud*_*dry 5 uikit popover ipad uipopovercontroller ios
我尝试从iOS 5上的UIPopoverControler更改颜色.为此,我使用UIPopoverBackgroundView的子类,我将其分配给我的popover,如下所示:
self.popover.popoverBackgroundViewClass = [KWPopoverBackgroundView class];
Run Code Online (Sandbox Code Playgroud)
正如我在KWPopoverBackgroundView类中定义的那样,我的popover现在是黑色的,但我的外观仍有问题.我的popover中的navigationController的后退按钮(Medals)仍为蓝色.我希望所有的东西都是黑色的.我如何摆脱这种蓝色?

我试图改变我的navigationController.navigationBar的tintColor,但当然popover并不关心它.有没有办法在iOS 5.0中解决这个问题?(我的应用程序在AppStore上,我不想要一个丑陋的黑客来解决这个问题)谢谢.
Lud*_*dry 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]];
Run Code Online (Sandbox Code Playgroud)

| 归档时间: |
|
| 查看次数: |
4397 次 |
| 最近记录: |