首页 > 其他 > 详细

UITabBar 设置字体的颜色(选中状态/正常状态)setTitleTextAttributes

时间:2016-02-20 13:21:59      阅读:219      评论:0      收藏:0      [点我收藏+]

UITabbar有个setTintColor这个方法,可以理解为,高亮的时候,或者点击后的颜色设置。


UITabBarItem有个setTitleTextAttributes的方法,是用来设置字体的颜色。

 

[[UITabBarItem appearance] setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:

                                                       [UIColor redColor], NSForegroundColorAttributeName,

                                                       nil] forState:UIControlStateNormal];

    UIColor *titleHighlightedColor = [UIColor greenColor];

    [[UITabBarItem appearance] setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:

                                                       titleHighlightedColor, NSForegroundColorAttributeName,

                                                       nil] forState:UIControlStateSelected];

UITabBar 设置字体的颜色(选中状态/正常状态)setTitleTextAttributes

原文:http://www.cnblogs.com/lrr0618/p/5203093.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!