【问题标题】:Image rotation around the lower right edge iOS围绕iOS右下边缘的图像旋转
【发布时间】:2015-04-29 18:20:20
【问题描述】:

我正在尝试围绕右下边缘旋转图像。

现在它围绕中心旋转。

CATransform3D transform = CATransform3DIdentity;
transform.m34 = 1.0f/-800.0f; // perspective
transform = CATransform3DRotate(transform, (M_PI * 90), 0.0f, 0.0f, 1.0f);

if (animation)
{
    [UIView animateWithDuration:0.9
                     animations:^{
                         [[_sendRecordView layer] setTransform:transform];
                     } completion:NULL];
}
else
{
   [[_sendRecordView layer] setTransform:transform];
}

【问题讨论】:

    标签: ios xcode uiimageview


    【解决方案1】:

    你需要设置这个:

    [_sendRecordView layer].anchorPoint = CGPointMake(X, Y);
    

    其中 X 和 Y 是所需的右下边缘点。

    编辑: 默认情况下,视图围绕中心旋转,因为锚点位于该位置。

    【讨论】:

    • 我认为默认值为 0.5,0.5 - 在中心。我试过了,视图向上和向左移动。
    猜你喜欢
    • 1970-01-01
    • 2018-06-08
    • 1970-01-01
    • 2011-10-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-05-19
    相关资源
    最近更新 更多