美文网首页
CALayer动画需要注意的事项

CALayer动画需要注意的事项

作者: 南国青天 | 来源:发表于2019-10-16 10:59 被阅读0次

    UIView.animate方法内执行CALayer动画

    UIView.animate(withDuration: 10, delay: 0.0, options: .curveEaseOut, animations: {
            self.layer.transform = CGAffineTransform(scaleX: 62.4, y: 62.4)
     },completion: {  finish in
            UIView.animate(withDuration: 0.6, delay: 0.0, options: .curveEaseOut, animations: {
                    self.layer.transform = CGAffineTransform(scaleX: 50, y: 50)
                })
        })
    

    需要注意: self.layer如果是CALayer类型, 那执行动画的时间并非由duration控制.

    相关文章

      网友评论

          本文标题:CALayer动画需要注意的事项

          本文链接:https://www.haomeiwen.com/subject/gdpymctx.html