CABasicAnimation with CALayer path doesn't animate

后端 未结 3 1127
不知归路
不知归路 2020-12-16 12:16

I\'m trying to animation the transition of a CALayer from normal corners to rounded corners. I only want to round the top corners, so I am using a UIBezierPath. Here\'s the

3条回答
  •  自闭症患者
    2020-12-16 12:36

    Found a really elegant solution from Andrew Wagner here.

    Esstentially the system will handle all path change animations, all you need is to:

    1. Implement a CAShapeLayer subclass
    2. Override and implement actionForKey
    3. Update the path as per usual and you'll get your animations!

提交回复
热议问题