如何在iOS中获得旋转UIView的完美X,Y位置 [英] How to get perfect X , Y position of rotating UIView in ios

查看:420
本文介绍了如何在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位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆