我搜索并尝试了所有可能的解决方案无济于事。我想要的是将未选择的默认灰色颜色更改为更暗的颜色。我正在使用Xcode 5和iOS 7.有人会帮忙吗?
(我尝试了所有这些以及更多:How can I change the text and icon colors for tabBarItems in iOS 7?)
答案 0 :(得分:0)
realtyTypeTabBar.selectedImageTintColor = [UIColor colorWithRed:206.0/256.0 green:221.0/256.0 blue:166.0/256.0 alpha:1];
[realtyTypeTabBar setSelectionIndicatorImage:[UIImage emptyImageWithSize:itemSize andBackgroundColor:[UIColor colorWithRed:84.0/256.0 green:115.0/256.0 blue:0 alpha:1]]];
for(UITabBarItem* item in realtyTypeTabBar.items)
{
item.image = [item.image imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
[item setTitleTextAttributes:@{NSForegroundColorAttributeName : [UIColor whiteColor]} forState:UIControlStateNormal];
[item setTitleTextAttributes:@{NSForegroundColorAttributeName : realtyTypeTabBar.tintColor} forState:UIControlStateSelected];
}
答案 1 :(得分:0)