更改颜色tabbar图标iOS 5

时间:2011-10-19 11:09:30

标签: xcode ios5 uitabbar

我能够使用以下命令重新设置UITabBar

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

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

由于

2 个答案:

答案 0 :(得分:3)

来自Apple docs UITabBar类参考:

  

如果您还要自定义未选择的图像外观,则必须将setFinishedSelectedImage:withFinishedUnselectedImage:发送到单个标签栏项目。

答案 1 :(得分:3)

  

在AppDlegate.m中

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
[[UITabBar appearance] setSelectedImageTintColor:[UIColor redColor]];
return YES;
}
相关问题