中心一个UIImageView我有一个UIImageView
应从size (0,0) --> (93,75)
动画从UIImageView的
动画我已经
[UIView animateWithDuration:0.5 delay:0 options:UIViewAnimationOptionTransitionNone
animations:^{
imgButton.layer.anchorPoint = CGPointMake(imgButton.bounds.size.width/2, imgButton.bounds.size.height/2);
CGRect btnFrame = imgButton.frame;
btnFrame.size.width = 105;
btnFrame.size.height = 85;
imgButton.frame = btnFrame;
}
completion:^(BOOL finished) {
[self animageButton2:imgButton];
}];
这是工作,但我唯一的问题是,它是不是动画以下从UIImageView
的中心,但从左上角。
有人有线索吗?
您是否真的阅读过'anchorPoint'的文档?我猜不是,因为你没有给它正确的价值。此外,它仅适用于'CGAffineTransform'操作,而不是大小。如果你想这样做,你将不得不自己调整原点。我建议将刻度设置为零并将其设置为1. – borrrden