当前位置: 代码迷 >> 综合 >> presentationlayer layer modallayer
  详细解决方案

presentationlayer layer modallayer

热度:32   发布时间:2024-01-12 00:02:17.0

进行了个测试 


向上移动


  CABasicAnimation * animation = [AnimationUtil translate3d:CATransform3DMakeTranslation(0, -100, 100) dur:1 direction:1 repeatCount:0];

    [_mView.layer addAnimation:animation forKey:nil];

    _mView.layer.transform =CATransform3DMakeTranslation(0, -100, 0);

向下移动

 CABasicAnimation * animation2 = [AnimationUtil translate3d:CATransform3DMakeTranslation(0, 100, 0) dur:1 direction:1 repeatCount:0];

    [_mView.layer addAnimation:animation2 forKey:nil];

    _mView.layer.transform =CATransform3DMakeTranslation(0, 100, 0);

presentationlayer只在第一次动画后就origin位置就不变了即使设置了.layer.transform,modallayer一开始就变了(modalayer在那里按钮的监听就在modallayer对应的位置)layer也是随着layer.transform改变而改变 ,如果把layer.transform注释掉就和presentationlayer一起随着动画动而改变值


用CATransform3D实现的动画会非常连续