有关Layer的anchorPoint的设置
在设置Layer的AnchorPoint的时候,View的frame.origin也会随之改变,
所以就有了如下函数
所以就有了如下函数
func setAnchorPoint(point:CGPoint,view:UIView){
let oldFrame = view.frame;
view.layer.anchorPoint = point;
view.frame = oldFrame;
}
而且。。AnchorPoint的范围是(0,0)~(1,1) 一不小心写成了坐标就又成了坑。。
评论
发表评论