iPhone:沿曲线绘制对象 [英] iPhone: draw the objects along the curve
问题描述
朋友,好日子。
有个任务:沿着曲线绘制重复的对象(UIImageView和UILabel)(更确切地说,是一条弧线)。
There is a task: to draw repeating objects (UIImageView and UILabel) along the curve (if more exactly, it's an arc).
应使用什么类?
推荐答案
您可以使用
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.
要旋转视图,请使用 <$ c UIView的$ c> transform 属性(请参见此问题有关如何使用它的示例)。但是请注意,然后您需要忽略框架
(未定义),并需要通过修改 center
。
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.
这篇关于iPhone:沿曲线绘制对象的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!