iPhone:沿曲线绘制对象 [英] iPhone: draw the objects along the curve

查看:96
本文介绍了iPhone:沿曲线绘制对象的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

朋友,好日子。

有个任务:沿着曲线绘制重复的对象(UIImageView和UILabel)(更确切地说,是一条弧线)。

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

应使用什么类?

推荐答案

您可以使用Path /Reference.html rel = nofollow noreferrer> UIBezierPath 或 CGPath 。前者是Objective-C,后者是纯C。我建议使用UIBezierPath,因为它更易于使用。

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆