【发布时间】:2010-12-30 09:28:15
【问题描述】:
我想更改anchorPoint,但将视图保持在同一位置。
我尝试过NSLog-ing self.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
【问题讨论】:
标签: iphone cocoa cocoa-touch uiview