当用户点击其超级视图时,我正在运行此代码以缩小 UIView。然而,当应用 CGAffineTransformScale() 时,它也会改变中心。这是预期的行为吗?
-(void) onTap:(UITapGestureRecognizer *)tap{
[UIView animateWithDuration:1.2
delay:0
options:0
animations:^{
CGAffineTransform transform = self.icon.transform;
NSLog(@"Previous center: %@", NSStringFromCGPoint(self.icon.center));
self.icon.transform = CGAffineTransformScale(transform, 0.5, 0.5);
NSLog(@"Next center: %@", NSStringFromCGPoint(self.icon.center));
} completion:^(BOOL finished) {
//
}];
}