【发布时间】:2017-08-02 14:58:41
【问题描述】:
所以我在 Xcode 中为标签栏使用原生的“更多”功能。我设法以编程方式设置导航栏和标题颜色的样式。
//sets the font color
UINavigationBar.appearance().titleTextAttributes = [NSAttributedStringKey.foregroundColor.rawValue: UIColor.white]
//sets the tint color, which dictates the button color
UINavigationBar.appearance().tintColor = UIColor.white
//sets the Bar tint color
UINavigationBar.appearance().barTintColor = UIColor(red: 0/255, green: 175/255, blue: 65/255, alpha: 1.0)
但是有没有办法改变这些蓝色图标的色调(参考下面的图片)?我上传的图像是绿色的,但它被着色了,我找不到设置。有人知道怎么改吗?
【问题讨论】:
-
你想改变 TabBar 或 NavigationBar 的颜色吗?
-
@saroshmirza 我想在表格视图和“编辑”功能中更改单元格左侧的蓝色图像/图标的色调。检查帖子底部的图片链接以供参考:)
-
@JamesRhymer 蓝色显示的项目是图片还是按钮?
-
@Maddyヅヅ 它们只是分配给标签栏上视图控制器的图像。仅当您单击“更多”以查看所有其他连接的视图控制器时,才会显示蓝色。它们在标签栏上的颜色都正确,但是当我点击“更多”时,图像仍然是蓝色的。
-
你有给图像着色吗?