改变uitabbaritem的文字颜色 [英] changing text color of uitabbaritem

查看:96
本文介绍了改变uitabbaritem的文字颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

任何人都可以帮助我解决这个奇怪的问题,无论如何都要将uitabbar项目的文本颜色从默认灰色更改为白色,将所选颜色更改为蓝色。

can anyone help me in this weird problem is there anyways to change the text color of uitabbar item from default gray to white and selected color to blue.

推荐答案

老问题,但我有一个新的答案,iOS 5以后支持(我也使用LLVM 4.0文字)

Old question, but I have a new answer that is supported in iOS 5 onwards (also I'm using LLVM 4.0 literals)

[[UITabBarItem appearance] setTitleTextAttributes:@{ NSForegroundColorAttributeName : [UIColor whiteColor] }
                                         forState:UIControlStateNormal];
[[UITabBarItem appearance] setTitleTextAttributes:@{ NSForegroundColorAttributeName : [UIColor blueColor] }
                                         forState:UIControlStateSelected];

这篇关于改变uitabbaritem的文字颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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