美文网首页
iOS CALayer的概念/anchorPoint的使用

iOS CALayer的概念/anchorPoint的使用

作者: 大城子 | 来源:发表于2018-12-05 15:27 被阅读5次

CALayer是什么

  • CALayer负责的是UIView可视内容的显示工作, 基本上UIView所有的可视化内容都是由CALayer负责显示的
  • CALayer不具备处理交互事件的功能, 只负责显示, 是UIView的子模块
  • 每一个UIView视图都有一个layer根容器, 可以往此跟layer容器上添加新的CALayer实例


    image.png

anchorPoint的使用:

  • 简单理解:一般调整layer位置都是用position, 默认position为layer的中心位置,调整layer位置时, 以position在layer中心为前提进行调整;调整anchorPoint后, 视觉上调整的是position在layer内的看起来的位置


    image.png

常用的一些属性与API参考下面的文章:
https://www.jianshu.com/p/55e0fa27f817

相关文章

网友评论

      本文标题:iOS CALayer的概念/anchorPoint的使用

      本文链接:https://www.haomeiwen.com/subject/oxcwcqtx.html