03百思不得姐appearance使用
来源:互联网 发布:数据融合方法 编辑:程序博客网 时间:2024/04/30 00:42
通过appearance设置统一UITabBarItem属性
apperance介绍
***To customize the appearance of all instances of a class, send the relevant appearance modification messages to the appearance proxy for the class. For example, to modify the bar tint color for all UINavigationBar instances: [[UINavigationBar appearance] setBarTintColor:myColor]; Note for iOS7: On iOS7 the tintColor property has moved to UIView, and now has special inherited behavior described in UIView.h. This inherited behavior can conflict with the appearance proxy, and therefore tintColor is now disallowed with the appearance proxy.***
//未选中状态 NSMutableDictionary *attrs = [NSMutableDictionary dictionary]; attrs[NSFontAttributeName] = [UIFont systemFontOfSize:12]; attrs[NSForegroundColorAttributeName] = [UIColor grayColor]; //选中状态 NSMutableDictionary *selectedAttrs = [NSMutableDictionary dictionary]; selectedAttrs[NSFontAttributeName] = [UIFont systemFontOfSize:12]; selectedAttrs[NSForegroundColorAttributeName] = [UIColor darkGrayColor]; //后面带有UI_APPEARANCE的方法,都可以通过appearance对象统一设置设置 UITabBarItem *item = [UITabBarItem appearance]; [item setTitleTextAttributes:attrs forState:UIControlStateNormal]; [item setTitleTextAttributes:selectedAttrs forState:UIControlStateSelected];
0 0
- 03百思不得姐appearance使用
- 《百思不得姐》
- 百思不得姐
- 百思学习笔记03-appearance
- 03-百思不得姐(第三天)
- 使用Kotlin实现百思不得姐弹出菜单
- 百思不得姐项目学习总结
- 02-百思不得姐(第二天)
- 04-百思不得姐(第四天)
- 02百思不得姐设置TabBar
- 百思不得姐框架(一)
- 06-百思不得姐(第六天)
- 百思不得姐框架(二)
- 百思不得姐自定义TabBar
- 07-百思不得姐(第七天)
- 09-百思不得姐(第九天)
- iOS 高仿《百思不得姐》
- 百思不得姐视频爬取
- hdu2844 Coins(多重背包)
- Web必知必会Cookie与Session
- 类型转换函数与转换构造函数执行优先情况
- fork()生成子进程
- iOS AFNetworking 3.0 的使用
- 03百思不得姐appearance使用
- hdu 2089 不要62(简单数位dp)
- 20160301.CCPP体系详解(0040天)
- Intent Flag介绍 intent.addFlags()
- HDU 4548 美素数(打表呀,有个小技巧)
- Poj 1065 Wooden Sticks【贪心+LIS?】
- FZU——2111Min Number(多次交换得到最小数,水题)
- Android中moveTo、lineTo、quadTo、cubicTo、arcTo详解
- 问题 - Android - 命令行adb命令出现error