UITabBarItem改变字体颜色
2015-09-04 16:14
369 查看
UITabBarItem正常状态下的字体颜色
[[UITabBarItem
appearance] setTitleTextAttributes:[NSDictionary
dictionaryWithObjectsAndKeys:[UIColor
colorWithRed:154.0/255
green:254.0/255
blue:158.0/255
alpha:1.0],
NSForegroundColorAttributeName,
nil]
forState:UIControlStateNormal];
加了如上设置之后
controller.tabBar.tintColor =
[UIColor whiteColor];////UITabbarController的tintColor将会对选中时的字体无效
所以还需加上如下设置
UITabBarItem选中状态下的字体颜色
[[UITabBarItem
appearance] setTitleTextAttributes:[NSDictionary
dictionaryWithObjectsAndKeys:[UIColor
whiteColor], NSForegroundColorAttributeName,
nil]
forState:UIControlStateSelected];
[[UITabBarItem
appearance] setTitleTextAttributes:[NSDictionary
dictionaryWithObjectsAndKeys:[UIColor
colorWithRed:154.0/255
green:254.0/255
blue:158.0/255
alpha:1.0],
NSForegroundColorAttributeName,
nil]
forState:UIControlStateNormal];
加了如上设置之后
controller.tabBar.tintColor =
[UIColor whiteColor];////UITabbarController的tintColor将会对选中时的字体无效
所以还需加上如下设置
UITabBarItem选中状态下的字体颜色
[[UITabBarItem
appearance] setTitleTextAttributes:[NSDictionary
dictionaryWithObjectsAndKeys:[UIColor
whiteColor], NSForegroundColorAttributeName,
nil]
forState:UIControlStateSelected];
相关文章推荐
- Warning: Multiple build commands for output file /xxx
- 1051. Pop Sequence (25)
- HDU 5412 CRB and Queries 求区间第k小 CDQ分治+整体二分
- iOS:UIScrollView控件和UIPageControl控件的详解
- 01-复杂度2 Maximum Subsequence Sum (25分)
- [flume]AvroRuntimeException: Excessively large list allocation request detected
- POJ 题目3368 ||HDOJ 题目1806 Frequent values(RMQ)
- 用于打印UID和GID
- iOS 在UILabel显示不同的字体和颜色
- [APUE] 再读之进程环境
- JAVA如何获取GUID
- Algorithms - Week 2-0 Stacks and Queues
- 因为发现对象名称 'dbo.T3' 和索引名称 'PK__T3__3214EC2706CC942B' 有重复的键,所以 CREATE UNIQUE INDEX 语句终止。重复的键值为 (1)。
- 【白书之路】1584 - Circular Sequence 最小字典序
- 让UIScrollView只有一边有弹簧效果
- Unique Binary Search Trees
- UITableView隐藏多余的分割线
- iOS Programming The Big Nerd Ranch Guide (4th Edition)
- UICollectionViewCell 多选知识点总结
- Team Queue (uva540 队列模拟)