记录四者之间的关系
frame.origin.x = position.x - anchorPoint.x * bounds.size.width;
frame.origin.y = position.y - anchorPoint.y * bounds.size.height;
Frame
描述当前视图在其父视图中的位置和大小
bounds
描述当前视图在其自身坐标系统中的位置和大小
anchorPoint
AnchorPoint 属于 iOS CoreAnimation层。图层的anchorPoint属性是一个CGPoint值,是变换的支点。AnchorPoint值的范围是0~1.
position
anchorPoint的点在superlayer中的坐标。
position是layer中的anchorPoint在superLayer中的位置坐标,通过公式可以得出。
不同属性改变时的结果
1.修改position
frame改变,anchorPoint不变
2.修改frame
position改变,anchorPoint不变
3.修改anchorPoint
frame改变
参考:
http://blog.csdn.net/yongyinmg/article/details/37927793
http://www.jcodecraeer.com/IOS/2015/0204/2413.html