【发布时间】:2015-05-06 19:59:31
【问题描述】:
我正在尝试更改 TabBarController 中图标的颜色。 我已成功更改了 textcolor(就在图标下方),但不知道如何更改图标颜色。
我已经像这样更改了图标文本颜色:
UITabBarItem.appearance().setTitleTextAttributes([NSForegroundColorAttributeName: UIColor.orangeColor()], forState:.Selected)
UITabBarItem.appearance().setTitleTextAttributes([NSForegroundColorAttributeName: UIColor.whiteColor()], forState:.Normal)
我已将其放入我的 AppDelegate.swift (didFinishLaunchingWithOptions)。 现在选中的项目文本是橙色的,未选中的是白色的。 然而,图标仍然是蓝色/深灰色。如何更改这些?
未选中:
已选择:
【问题讨论】:
标签: swift colors ios8 icons tabbarcontroller