我有5个UIBarButtonItems,它将仅更改2个颜色。
如何在xcode 5中做到这一点?

非常感谢您的回答!

我必须在AppDelegate.m中添加什么代码?

[[UINavigationBar appearance] setBarTintColor:UIColorFromRGB (0x34AADC)];

[[UIApplication sharedApplication] setStatusBarStyle: UIStatusBarStyleLightContent];

[[UINavigationBar appearance] setTitleTextAttributes:@{NSForegroundColorAttributeName : [UIColor whiteColor]}];

[[UIBarButtonItem appearance] setTintColor:[UIColor whiteColor]];

[[UINavigationBar appearance] setTintColor:[UIColor whiteColor]];

[[UIToolbar appearance] setBarTintColor:UIColorFromRGB (0x34AADC)];

最佳答案

还有一种方法如下:

[[UIBarButtonItem appearanceWhenContainedIn:[<The class in which you want to set custom color> class], nil] setTintColor:<myColor>];

关于ios - 更改自定义uibarbuttonitem(iOS7)的颜色,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/22581530/

10-12 01:49