【问题标题】:CATransform3D breaks UIView into two parts before animationCATransform3D 在动画之前将 UIView 分成两部分
【发布时间】:2014-05-19 21:24:40
【问题描述】:

我对 CATransform3D 有疑问。 当我尝试进行 Y 轴旋转时,UIView 在动画开始之前分成两部分。

一张图片胜过一千个字……

代码如下:

CATransform3D _3Dt = CATransform3DMakeRotation(2.0 * M_PI, 0.0, 1.0, 0.0);
[UIView animateWithDuration:2.0
                 animations:^{
                     view.layer.transform = _3Dt;
                 }];

有什么想法吗?

谢谢!

【问题讨论】:

    标签: uiview transform axis layer catransform3d


    【解决方案1】:

    解决了!

    问题出在layer.zPosition

    这是最终代码:

    view.layer.zPosition = CGRectGetWidth(view.bounds);
    CATransform3D _3Dt = CATransform3DMakeRotation(2.0 * M_PI, 0.0, 1.0, 0.0);
    [UIView animateWithDuration:2.0
                     animations:^{
                         view.layer.transform = _3Dt;
                     }];
    

    谢谢!

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-07-14
      • 1970-01-01
      • 1970-01-01
      • 2019-11-30
      • 1970-01-01
      相关资源
      最近更新 更多