我现在正在为 iOS 设备
实现一个 app
,所以在 objective C
中,我在问如何保持原点在旋转之后定位 UIImageView
?
例如,我这样使用我的 UIImageView
:
CGAffineTransform initialPosition = CGAffineTransformMakeRotation(0);
CGAffineTransform finalPosition = CGAffineTransformMakeRotation(M_PI/2);
[UIView beginAnimations: @"Rotate animation" context: NULL];
MySuperUIImageView.transform = initialPosition;
[UIView setAnimationDuration:1.0];
[UIView setAnimationRepeatAutoreverses:NO];
[UIView setAnimationRepeatCount:1];
[UIView setAnimationDelegate:self];
MySuperUIImageView.transform = finalPosition;
[UIView commitAnimations];
但之后,我让它消失了一段时间,使用:
MySuperUIImageView.alpha = 0.0f;
当我再次使用它时,我希望它处于第一个原始位置,没有旋转。容易吗?
提前致谢!
最佳答案
是的。很容易:
MySuperUIImageView.transform = CGAffineTransformIdentity;
关于ios - 回到原来的位置 UIImageView,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18550901/