我有一个图像网格,我在单击图像时放大和缩小。一切正常,但我无法控制 CGAffineTransform 的旋转。我想我可以通过角度来控制我的旋转是如何确定的,但是当我这样做时,变换不会放大,我会被缩小。
我觉得我在创建例程期间错过了某个地方的正确实现,所以如果有人能指出我哪里出错了,我会很感激这是我的代码
float angle = -1.661799;
if(status == 0){
[UIView animateWithDuration:1.5f delay:0.0f
options:UIViewAnimationOptionCurveEaseIn animations:^{
CGAffineTransform totalTransform =
CGAffineTransformMakeTranslation(-middleX , -middleY );
totalTransform = CGAffineTransformScale(totalTransform, 3.5f, 3.5f);
totalTransform = CGAffineTransformTranslate(totalTransform, middleX , middleY );
//totalTransform = CGAffineTransformMakeRotation(angle);
[self.view setTransform:totalTransform];
}completion:^(BOOL finished) {
}];
status++;
}else{
[UIView animateWithDuration:1.3f delay:0.0f
options:UIViewAnimationOptionCurveEaseIn animations:^{
CGAffineTransform tr = CGAffineTransformMakeScale(1.00 ,1.00);
[self.view setTransform:tr];
}completion:^(BOOL finished) {
[UIView animateWithDuration:1.3f delay:0.0f
options:UIViewAnimationOptionCurveEaseIn animations:^{
CGAffineTransform totalTransform =
CGAffineTransformMakeTranslation(-middleX , -middleY );
totalTransform = CGAffineTransformScale(totalTransform, 3.5f, 3.5f);
totalTransform = CGAffineTransformTranslate(totalTransform, middleX , middleY );
//totalTransform = CGAffineTransformMakeRotation(angle);
[self.view setTransform:totalTransform];
}completion:^(BOOL finished) {}];
}];
status = 0;
}