码迷,mamicode.com
首页 > 移动开发 > 详细

【IOS】修改TabBar属性

时间:2014-09-14 23:38:37      阅读:355      评论:0      收藏:0      [点我收藏+]

标签:style   blog   color   io   os   ar   for   div   sp   

 1  if (IOS7) {
 2 
 3 
 4         //ios7下,tabbar选中的文字颜色
 5 
 6         _tabBarController.tabBar.tintColor = COLOR(245, 254, 0, 1);
 7 
 8     }
 9 
10     else {
11 
12         //ios6下,tabbar选中的文字颜色
13 
14         [[UITabBarItem appearance] setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:
15 
16                                                            COLOR(245, 254, 0, 1), UITextAttributeTextColor,nil]
17 
18                                                  forState:UIControlStateHighlighted];
19 
20     }
21     //修改tabbar背景图
22   _tabBarController.tabBar.backgroundImage = LOADPNGIMAGE(@"TabbarBG");
23 
24 
25 //修改选中和未选中的图片
26  [viewController.tabBarItem setFinishedSelectedImage:[UIImage imageNamed:[NSString stringWithFormat:@"%@按下.png",imageArr[i]]] withFinishedUnselectedImage:[UIImage imageNamed:[NSString stringWithFormat:@"%@弹起.png",imageArr[i]]]];

 

【IOS】修改TabBar属性

标签:style   blog   color   io   os   ar   for   div   sp   

原文地址:http://www.cnblogs.com/DannyApple/p/3971926.html

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