How do I create a smoothly resizable circular UIView?

前端 未结 4 1607
温柔的废话
温柔的废话 2020-12-13 22:09

I\'m trying to create a UIView which shows a semitransparent circle with an opaque border inside its bounds. I want to be able to change the bounds in two ways - inside a <

4条回答
  •  自闭症患者
    2020-12-13 22:55

    The path property of a CAShapeLayer isn't implicitly animatable, but it is animatable. It should be pretty easy to create a CABasicAnimation that changes the size of the circle path. Just makes sure that the path has the same number of control points (e.g. changing the radius of a full-circle arc.) If you change the number of control points, things get really strange. "Results are undefined", according to the documentaiton.

提交回复
热议问题