UIAppearence Protocol
来源:互联网 发布:网络侵权管辖最新规定 编辑:程序博客网 时间:2024/06/06 18:40
- appearance
- UI_APPEARANCE_SELECTOR
appearance
+ (instancetype)appearance;
该属性能够定制一个类的事例的外观.发送和外观(appearence)相关的消息给这个类的appearence代理.
例如去修改UINavigationBar
实例的bar的tint color可以用下面的代码:
[[UINavigationBar appearance] setBarTintColor:myColor];
在iOS7,tintColor这个属性移到了UIView,并且继承了一些特殊的行为.
继承的行为会与appearance代理产生冲突,所以tintColor不再允许在appearance代理中了.
UI_APPEARANCE_SELECTOR
UI_APPEARANCE_SELECTOR
的定义:
#define UI_APPEARANCE_SELECTOR __attribute__((annotate("ui_appearance_selector")))
可以看出这时一个宏.
作为appearance 代理API的一部分,在header中用来标记外观属性的selector,
例如:
- (void)setProperty:(PropertyType)property forAxis1:(IntegerType)axis1 axis2:(IntegerType)axis2 axisN:(IntegerType)axisN; - (PropertyType)propertyForAxis1:(IntegerType)axis1 axis2:(IntegerType)axis2 axisN:(IntegerType)axisN;
这里的PropertyType
可以是iOS中的任何标准类型: id, NSInteger, NSUInteger, CGFloat, CGPoint, CGSize, CGRect, UIEdgeInsets or UIOffset.
IntegerType必须要么是NSInteger或NSUInteger;
如果不是的话,那么会抛出异常的.
所有内容摘自
UIAppearance.h
文件中.
阅读全文
0 0
- UIAppearence Protocol
- iOS 【UIAppearence 使用几点注意】
- Protocol
- protocol
- Protocol
- protocol
- @protocol
- Protocol
- Protocol
- protocol
- protocol
- protocol
- Protocol
- protocol
- protocol
- Protocol
- BT Protocol
- eDonkey2000 Protocol
- 卡特兰数——Catalan数
- iOS网络底层实现
- js实现小特效 下拉菜单的折叠
- 使用阿里云服务器遇到的一些问题及解决办法
- 每个程序员都有责任去锻炼
- UIAppearence Protocol
- linux 下去掉^M
- RN 开发中android 版本升级步骤
- c语言文件读写相关函数
- 图像分割
- 55--寻找倍数
- centos6.5的php5.3.3 通过yum升级到5.6
- 【zoj】System overload
- tensorflow2caffe(1) : caffemodel解析,caffemodel里面到底记录了什么?