我如何更改未选中的UITabBarItem标题和背景图像在iOS 8中的tintColor?
未选中状态的默认颜色是浅灰色,但它在我的较暗 UITabBar 背景下不显示。
我希望我的未选中状态的颜色为[UIColor blackColor]。
在我的应用程序委托的didfinishlaunchingwithoptions:方法中,我有以下代码:
UIImage *deselectedE = [[UIImage imageNamed:@"mincraft_axe_green_32.png"] imageWithRenderingMode:UIImageRenderingModeAutomatic];
UIImage *selectedE = [[UIImage imageNamed:@"mincraft_axe_green_32.png"] imageWithRenderingMode:UIImageRenderingModeAutomatic];
e.tabBarItem = [[UITabBarItem alloc] initWithTitle:@"Profile" image:deselectedE selectedImage:selectedE];
[[UITabBar appearance] setTintColor:[UIColor blackColor]];
tabBarCtrl.tabBar.unselectedItemTintColor = UIColor.gray
来设置未选中选项卡的灰色颜色。 - Anchor