UIAppearance Protocol Reference
来源:互联网 发布:编程猫软件下载 编辑:程序博客网 时间:2024/06/08 06:13
ios5增加的两个统一定制控件样式的函数,具有全局的效果,一劳永逸。用法很简单,文档如下:
UIAppearance Protocol Reference
Overview
You use the UIAppearance
protocol to get the appearance proxy for a class. You customize the appearance of instances of a class by sending appearance modification messages to the class’s appearance proxy.
There are two ways to customize appearance for objects: for all instances, and for instances contained within an instance of a container class.
//To customize the appearance of all instances of a class, you use appearance to get the appearance proxy for the class. For example, to modify the tint color for all instances ofUINavigationBar:[[UINavigationBar appearance] setTintColor:myColor];//To customize the appearances for instances of a class when contained within an instance of a container class, or instances in a hierarchy, you useappearanceWhenContainedIn: to get the appearance proxy for the class:[[UIBarButtonItem appearanceWhenContainedIn:[UINavigationBar class], nil] setTintColor:myNavBarColor];[[UIBarButtonItem appearanceWhenContainedIn:[UINavigationBar class], [UIPopoverController class], nil] setTintColor:myPopoverNavBarColor];[[UIBarButtonItem appearanceWhenContainedIn:[UIToolbar class], nil] setTintColor:myToolbarColor];[[UIBarButtonItem appearanceWhenContainedIn:[UIToolbar class], [UIPopoverController class], nil] setTintColor:myPopoverToolbarColor];
In any given view hierarchy, the outermost appearance proxy wins. Specificity (depth of the chain) is the tie-breaker. In other words, the containment statement inappearanceWhenContainedIn:
is treated as a partial ordering. Given a concrete ordering (actual subview hierarchy), UIKit selects the partial ordering that is the first unique match when reading the actual hierarchy from the window down.
To support appearance customization, a class must conform to the UIAppearanceContainer
protocol and relevant accessor methods must be marked with UI_APPEARANCE_SELECTOR
.
- UIAppearance Protocol Reference
- UIAppearance Proxy Protocol Tutorial/Example
- UIAppearance
- UIAppearance
- UIAppearance
- UIAppearance
- UIAppearance
- NSCoding Protocol Reference
- UIScrollViewDelegate Protocol Reference
- apple "Mobile Device Management Protocol Reference"
- The Apache Tomcat Connectors - AJP Protocol Reference
- UIAppearance用法
- UIAppearance用法
- UIAppearance协议
- 工具UIAppearance
- UIAppearance使用方法
- Protocol Buffers Developer Guide-API Reference --C++ Generated Code
- Protocol
- 关于kindeditor提交无法获取到获取到值的问题
- 做更好的自己:不值得你去做的30件事
- DEVICE_ATTR 和 sysfs 的东西 -- sysfs_create_group
- google的提供的语音到text的服务
- Java判断字符串是否为空
- UIAppearance Protocol Reference
- 解决 interop.word 外部组件异常
- EXCEL中将多个单元格内容合并到一个单元格中的方法(转帖+亲自实践)
- 嵌入chrome进入你的程序
- Openssl aes对称加密算法 加解密例程 1
- Access sql语句
- java学习——java中的时间处理
- javascript函数(二)--将函数作为参数传递
- 下拉菜单内容自动更新的技巧(转帖+亲自实践)