有关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) 一不小心写成了坐标就又成了坑。。

评论

此博客中的热门博文

使__attribute__((annotate("xxx")))能作用于OC函数

viewWillAppear不执行的解决办法

iOS中使用xpc/xpc.h