2
我想更改tabBar
中的项目颜色,而不是文本中没有选择的项目等。长期目标搜索它,我没有找到。我刚刚找到这个代码,它不会更改项目或图像的颜色,只是文本。 默认颜色是灰色的,我想改变它。如何在tabBar swift中更改项目或图像颜色?
这是我发现的代码:
UITabBar.appearance().barTintColor = UIColor(redRGB: 93, greenRGB: 175, blueRGB: 228)
UITabBar.appearance().tintColor = UIColor .redColor()
UITabBarItem.appearance().setTitleTextAttributes([NSForegroundColorAttributeName: UIColor.whiteColor()], forState:.Normal)
如何我可以改变灰度为红色样品? –
在你的故事板=>去你的UItabbar =>更改backgroundcolor – SamuelD
如果你想以编程方式做tyhat,你应该制作一个UITabbar控制器并在那里实现你的颜色变化 – SamuelD