iPhone: draw the objects along the curve

2019-03-04 11:47发布

Good day, friends.

There is a task: to draw repeating objects (UIImageView and UILabel) along the curve (if more exactly, it's an arc).

What classes should be used for it?

1条回答
Lonely孤独者°
2楼-- · 2019-03-04 12:04

As an alternative to Android's Path, you can use either UIBezierPath or CGPath. The former is Objective-C, the later pure C. I recommend going with UIBezierPath as it's easier to use.

To rotate a view, use the transform property of UIView (see this question for an example on how to use it). But note that you then need to ignore the frame (it's undefined) and need to move the view by modifying the center instead.

查看更多
登录 后发表回答