iPhone: draw the objects along the curve

荒凉一梦 提交于 2019-12-02 18:34:43

问题


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:


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.



来源:https://stackoverflow.com/questions/7103510/iphone-draw-the-objects-along-the-curve

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!