首页 > 移动平台 > 详细

iOS核心动画之anchorpoint

时间:2017-01-14 11:00:37      阅读:297      评论:0      收藏:0      [点我收藏+]
  1. anchorpoint是什么

    All geometric manipulations to the view occur about the specified point

    就是说所有的动画参考点都是anchorpoint。比如说旋转动画,就是说所有的点都围绕这个点做动画;再比如说缩放,就是说所有的点到锚点的距离变为原来的多少倍。

  2. anchorPoint和动画
    技术分享

  3. anchorpoint和frame、bounds、position
    每一个view都有对应的layer,layer的delegate是view。可以理解为访问、改变view的属性其实是在访问、改变layer的属性,只不过view可以相应点击事件。
    view的属性frame, bounds, center实际上就是layer的frame, bounds, position属性。
    anchorpoint是一个点,是相对位置,即{0,0}是左上角,{1,1}是右下角。一个layer的anchorpointposition是同一个点,只不过是在不同的坐标系下。anchorpoint在bounds的单位坐标系下,position是在super layer的坐标下。
    改变anchorpoint时,position不会改变,而是会改变frame的原点。满足frame.origin.x = position.x - anchorPoint.x*bounds.size.width
    技术分享

  4. 利用anchorpoint免去复杂的变换

  5. 资料

iOS核心动画之anchorpoint

原文:http://www.cnblogs.com/huahuahu/p/iOS-he-xin-dong-hua-zhianchorpoint.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!