【发布时间】:2014-12-20 12:00:44
【问题描述】:
如何更改未选择的 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]];
【问题讨论】:
-
在 iOS 10+ 和 swift 3 中你可以做到
tabBarCtrl.tabBar.unselectedItemTintColor = UIColor.gray
标签: ios ios8 uitabbaritem tintcolor bartintcolor