【发布时间】:2013-11-12 17:15:20
【问题描述】:
我在 UINavigationBar 上使用白色背景和 darkGrayColor 文本
[[UINavigationBar appearance] setBackgroundImage:[UIImage imageNamed:@"uinavigationcontrollerbackground"] forBarMetrics:UIBarMetricsDefault];
[[UINavigationBar appearance] setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:font,UITextAttributeFont ,[UIColor darkGrayColor], UITextAttributeTextColor, [UIColor whiteColor], UITextAttributeTextShadowColor, nil]];
这看起来不错,但我在整个应用程序中都有这样定义的按钮:
self.searchButton =[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemSearch target:self action:@selector(searchProducts)];
我取消了默认的 blakc 背景外观:
[[UIBarButtonItem appearance] setBackgroundImage:[UIImage imageNamed:@"uibarbuttonbackground"] forState:UIControlStateNormal
barMetrics:UIBarMetricsDefault];
这只是一个白色方块。
现在我的图标仍然是白色的,带有浅灰色阴影,是否要更改这些默认图标?
【问题讨论】:
标签: iphone ipad uibarbuttonitem ios5.1