简体   繁体   English

iPhone:沿曲线绘制对象

[英]iPhone: draw the objects along the curve

Good day, friends. 美好的一天,朋友们。

There is a task: to draw repeating objects (UIImageView and UILabel) along the curve (if more exactly, it's an arc). 有一项任务:沿着曲线绘制重复对象(UIImageView和UILabel)(如果更确切地说,它是一个弧形)。

What classes should be used for it? 应该使用哪些类?

As an alternative to Android's Path , you can use either UIBezierPath or CGPath . 作为Android的Path的替代方案,您可以使用UIBezierPathCGPath The former is Objective-C, the later pure C. I recommend going with UIBezierPath as it's easier to use. 前者是Objective-C,后者是纯C.我建议使用UIBezierPath,因为它更容易使用。

To rotate a view, use the transform property of UIView (see this question for an example on how to use it). 要旋转视图,请使用UIViewtransform属性 (有关如何使用它的示例,请参阅此问题 )。 But note that you then need to ignore the frame (it's undefined) and need to move the view by modifying the center instead. 但请注意,您需要忽略该frame (它是未定义的)并需要通过修改center来移动视图。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM