swift - 快速更改标签栏未选择的图标颜色

标签 swift uitabbarcontroller

我有标签栏,我想将图标颜色从默认的灰色更改为白色, 我在 AppDelegate 中添加了这一行

UITabBar.appearance().barTintColor = UIColor(red:0.51, green:0.39, blue:0.37, alpha:1.0)

这是更改选中的项目,我如何在未选中的情况下做到这一点?

最佳答案

以下为 Swift 使用:

self.tabBar.unselectedItemTintColor = UIColor.white

关于swift - 快速更改标签栏未选择的图标颜色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39245520/

相关文章:

Swift UITest - 找不到具有可访问性标识符的文本字段的匹配项

ios - 如何快速删除 UICollectionView 中各部分之间的空格

iphone - UITabBarController - 如何访问 View Controller ?

iphone - 在标签栏前面放一个 View

ios - 使用 UITabBarController 的持久 View

swift - SourceKitService 崩溃,Simulator 失败

php - Swift:NSURL 正确地从 Playground 中的 URL 返回 HTML,但在应用程序中使用时会使模拟器崩溃

ios - 如何在 Swift 中找出 Int 的最大值

ios - 使用 UITabController 时将数据传递到 UIViewController 的一般方法

objective-c - 如何以编程方式触发方法 "tabBarController:didSelectViewController:"?