首页 > 其他 > 详细

改变tabBarItem颜色

时间:2016-05-05 19:09:23      阅读:153      评论: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
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!