iOS UIAppearance使用介绍
来源:互联网 发布:陈丹丹淘宝店 编辑:程序博客网 时间:2024/06/03 04:46
iOS5及其以后提供了一个比较强大的工具UIAppearance,我们通过UIAppearance设置一些UI的全局效果,这样就可以很方便的实现UI的自定义效果又能最简单的实现统一界面风格,它提供如下两个方法。
+ (id)appearance
这个方法是统一全部改,比如你设置UINavBar的tintColor,你可以这样写:[[UINavigationBar appearance] setTintColor:myColor];
+ (id)appearanceWhenContainedIn:(Class <>)ContainerClass,...
这个方法可设置某个类的改变:例如:设置UIBarButtonItem 在UINavigationBar、UIPopoverController、UITabbar中的效果。就可以这样写
[[UIBarButtonItem appearanceWhenContainedIn:[UINavigationBar class], [UIPopoverController class],[UITabbar class] nil] setTintColor:myPopoverNavBarColor];
请注意*使用appearance设置UI效果最好采用全局的设置,在所有界面初始化前开始设置,否则可能失效。另外,+ (id)appearance有一定的延时,所以设置时注意.
0 0
- iOS UIAppearance使用介绍
- iOS UIAppearance使用详解
- iOS UIAppearance使用详解
- iOS UIAppearance使用详解
- iOS UIAppearance使用详解
- iOS中UIAppearance使用
- iOS UIAppearance使用详解
- iOS UIAppearance使用详解
- iOS UIAppearance使用详解
- iOS UIAppearance使用详解
- iOS UIAppearance使用详解
- iOS UIAppearance使用详解
- iOS UIAppearance使用详解
- iOS UIAppearance使用详解
- iOS UIAppearance使用详解
- iOS UIAppearance使用详解
- iOS UIAppearance使用详解
- iOS UIAppearance使用详解
- Compiling MongoDB C++ Driver, Boost Error (Windows)
- Gulp
- java 用类方法编写的例子
- 委托事件模拟unity生命周期
- 错误记录:单编launcher3时错误
- iOS UIAppearance使用介绍
- 关键业务系统的JVM启动参数推荐
- PHP基础知识 - 字符串处理
- 排序——归并排序
- C#获取ListView鼠标下的Item
- 二进制中1的个数
- java笔记--day10--内部类
- 十一章上机练习4
- 深入浅出学习Struts1框架:一个简单mvc模式代码示例开始