关于 xcode:change color tabbar icons iOS 5

change color tabbar icons iOS 5

我可以使用以下命令重新设置 UITabBar 的样式

1
2
3
[[UITabBar appearance] setSelectionIndicatorImage:
 [UIImage imageNamed:@"tab_select_indicator"]];
[[UITabBar appearance] setSelectedImageTintColor:[UIColor redColor]];

,但是如何在选项卡所选择时设置ImageTintColor。默认颜色为灰色,我想将其更改为蓝色。

谢谢


In AppDlegate.m

1
2
3
4
5
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
[[UITabBar appearance] setSelectedImageTintColor:[UIColor redColor]];
return YES;
}

来自 Apple 文档 UITabBar 类参考:

If you want to also customize the unselected image appearance, you must sent setFinishedSelectedImage:withFinishedUnselectedImage: to individual tab bar items.