- CALayer包含在QuartzCore框架中,这是一个跨平台的框架,既可以用在iOS中又可以用在Mac OS X中。而他的近亲UIView是在UIKit框架中,只能用在iOS中。
- UIView中有一个layer属性作为根图层,CALayer通过delegate持有UIView。
- 在UIView中所有能够看到的内容都包含在layer中。
-
隐式属性动画的本质是这些属性的变动默认隐含了CABasicAnimation动画实现,详情大家可以参照Xcode帮助文档中“Animatable Properties”一节。
-
在CALayer中很少使用frame属性,因为frame本身不支持动画效果,通常使用bounds和position代替。
-
CALayer中透明度使用opacity表示而不是alpha;中心点使用position表示而不是center。
-
anchorPoint属性是图层的锚点,范围在(0
1,01)表示在x、y轴的比例,这个点永远可以同position(中心点)重合,当图层中心点固定后,调整anchorPoint即可达到调整图层显示位置的作用(因为它永远和position重合
代理方式
自定义方式