从故事板更改标签栏图标/文本色调颜色 [英] Change Tab Bar icon/text tint color from Storyboard

查看:34
本文介绍了从故事板更改标签栏图标/文本色调颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经阅读了大约 10 个不同的帖子,例如这个他们都建议使用代码在您的应用委托中执行此操作.

I've read about 10 different posts like this one and they all suggest doing it in your app delegate with code.

甚至可以从故事板中更改它吗?

Is it even possible to change it from within the storyboard?

推荐答案

由于某种我不清楚的原因,Attributes Inspector 中的标准 Tint 属性不起作用.

For some reason that I'm not clear on, the standard Tint properties in the Attributes Inspector have no effect.

但是,如果您选择标签栏并打开身份检查器,您可以添加一个自定义的用户定义的运行时属性,其键路径为 tintColor,将其类型设置为 Color,然后以这种方式指定颜色.

However, if you select the tab bar and open up the Identity Inspector, you can add a custom User Defined Runtime Attribute with a Key Path of tintColor, set its type to be Color, and then specify the color that way.

我认为这不是理想的解决方案,但这是迄今为止我发现的唯一一种能够从 Interface Builder 控制颜色的方法.

Not the ideal solution I think, but it's the only way I've found so far of being able to control the color from Interface Builder.

这篇关于从故事板更改标签栏图标/文本色调颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆