我禁用了 tabBar 项,然后栏按钮变成了灰色。
我想更改它的颜色但不能这样做。它默认为灰色。
当我将 setEnabled 设置为 true 时,它会显示原始颜色白色。
[[[[self.tabBarController tabBar]items]objectAtIndex:0]setEnabled:FALSE];
最佳答案
我在 appDelegate
中使用过它,它对我来说效果很好。
[[UIView appearanceWhenContainedIn:[UITabBar class], nil] setTintColor:[UIColor whiteColor]];
[[UITabBar appearance] setTintColor:[UIColor whiteColor]];
但是当我在 viewController
类中设置 enable False 时,它将变为灰色。
关于ios - 如何在设置启用 False 时更改 TabBarItem 的颜色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30594353/