1.CALayer简介 CALayer是个与UIView很类似的概念,同样有backgroundColor.frame等相似的属性,我们可以将UIView看做一种特殊的CALayer.但实际上UIView是对CALayer封装,在CALayer的基础上再添加交互功能.UIView的显示必须依赖于CALayer.我们同样可以跟新建view一样新建一个layer,然后添加到某个已有的layer上,同样可以对layer调整大小.位置.透明度等.一般来说,layer可以有两种用途:一是对view相关属性…