【发布时间】:2014-01-22 03:24:48
【问题描述】:
我正在使用此代码更改 UITabBar 颜色、其文本颜色/字体和所选项目的颜色。
[[UITabBarItem appearance] setTitleTextAttributes:@{NSFontAttributeName : [UIFont fontWithName:@"HelveticaNeue-Light" size:10.0f],
NSForegroundColorAttributeName : [UIColor blackColor]
} forState:UIControlStateSelected];
[[UITabBarItem appearance] setTitleTextAttributes:@{NSFontAttributeName : [UIFont fontWithName:@"HelveticaNeue-Light" size:10.0f],
NSForegroundColorAttributeName : [UIColor whiteColor]
} forState:UIControlStateNormal];
//change tabbarcolor
[[UITabBar appearance] setBarTintColor:[UIColor redColor]];
//to change the tabbar elements color
[[UITabBar appearance] setTintColor:[UIColor greenColor]];
我的问题是我想更改 NON SELECTED UITabBarItems 的颜色,默认为灰色。我怎样才能做到这一点 ?
谢谢。
【问题讨论】:
标签: ios uitabbar uitabbaritem