ios - 如何在 iOS 中获得完美的旋转 UIView 的 X,Y 位置

标签 ios rotation position cabasicanimation

我正在使用 CABasicanimation 来旋转 UIView。我正在使用这段代码:

    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 位置。我怎样才能做到这一点?

enter image description here

最佳答案

我得到了这个问题的答案,请转到此链接寻找答案

Go to This Link For Answer

关于ios - 如何在 iOS 中获得完美的旋转 UIView 的 X,Y 位置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34763819/

相关文章:

ios - touchesBegan 局部变量

ios - 在 Core Graphics 中创建一个带有多色线段的圆

matlab - 如何使用 MATLAB 围绕不是图像中心点的点旋转图像?

html - 像网格一样的CSS定位

ios - 如何在 Core Data iOS Swift 中插入具有抽象父对象的对象

objective-c - 添加到主页功能

c# - 使用 Kinect SDK 创建完整的 3d 骨架

c++ - 计算 3D 对象和点之间的角度

r - GG图 : Two stacked bar plots side by side (not facets)

html - 带 z-index : -1 的可点击图像