我想改变的 anchorPoint
,但保持在同一个地方的观点。
我已经尝试了 NSLog
-ingself.layer.position
和 self.center
,无论锚点如何变化,它们都保持不变。但我的视野还是移动了!
有什么建议吗?
self.layer.anchorPoint = CGPointMake(0.5, 0.5);
NSLog(@"center point: %f %f", self.layer.position.x, self.layer.position.y);
self.layer.anchorPoint = CGPointMake(1, 1);
NSLog(@"center point: %f %f", self.layer.position.x, self.layer.position.y);
输出结果是:
2009-12-27 20:43:24.161 Type[11289:207] center point: 272.500000 242.500000
2009-12-27 20:43:24.162 Type[11289:207] center point: 272.500000 242.500000