当我缩放图层时,结果始终将原点设置为 CGPoint(0,0)。确保缩放后图层仍位于其超级图层中心的最佳方法是什么?
[CATransaction begin];
[CATransaction setAnimationDuration: 0];
[CATransaction setDisableActions: TRUE];
self.maskLayer.transform = CATransform3DScale(CATransform3DIdentity, .8, .8,1);
self.maskLayer.position = CGPointMake(kScreenWidth/2,kScreenHeight/2);
[CATransaction commit];