码迷,mamicode.com
首页 > 其他好文 > 详细

改变tabBarItem颜色

时间:2016-05-05 19:11:51      阅读:136      评论:0      收藏:0      [点我收藏+]

标签:

[[UITabBarItem appearance] setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:
                                                       [UIColor blackColor], NSForegroundColorAttributeName,
                                                       nil] forState:UIControlStateNormal];
UIColor *titleHighlightedColor = [UIColor colorWithR:52 g:168 b:132 a:1];
[[UITabBarItem appearance] setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys: titleHighlightedColor, NSForegroundColorAttributeName, nil] forState:UIControlStateSelected];

 上边是字体,下边是图片

[_secondVC.tabBarItem setImage:[[UIImage imageNamed:@"dianpu"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]];
[_secondVC.tabBarItem setSelectedImage:[[UIImage imageNamed:@"dianpu02"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]];

 

改变tabBarItem颜色

标签:

原文地址:http://www.cnblogs.com/wlsxmhz/p/5462764.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!