本文介绍了如何在iOS中获得旋转UIView的完美X,Y位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用CABasicanimation旋转UIView.我正在使用此代码,
I am using CABasicanimation for rotate an UIView. I am using this code,
CABasicAnimation *rotationAnimation = [CABasicAnimation animationWithKeyPath:@"transform.rotation.z"];
NSNumber *currentAngle = [CircleView.layer.presentationLayer valueForKeyPath:@"transform.rotation"];
rotationAnimation.fromValue = currentAngle;
rotationAnimation.toValue = @(50*M_PI);
rotationAnimation.duration = 50.0f; // this might be too fast
rotationAnimation.repeatCount = HUGE_VALF; // HUGE_VALF is defined in math.h so import it
[CircleView.layer addAnimation:rotationAnimation forKey:@"rotationAnimationleft"];
在这种情况下,我想在"UIView"旋转时获得完美的X,Y位置.如果有人知道,请帮助我.
in this i want perfect X,Y position while "UIView" is rotating.If anyone know please help me.
提前谢谢您.
推荐答案
我已经回答了这个问题,请转到此链接以获取答案
I Got A Answer Of This Question Please Go To This Link For Answer
这篇关于如何在iOS中获得旋转UIView的完美X,Y位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!