0

我正在开发一个具有大滚轮的应用程序 - 请参见此处:http ://aspyreapps.com/Files/Aspyre/wheels.jpg

轮子内的内容需要动态创建,而不是静态图形。问题是我需要内容表现得像一个轮子,所以当轮子转动时,内容的角度会相应改变——而不仅仅是直线上下移动。

关于我如何完成这样的事情有什么建议吗?

4

2 回答 2

0

Affine transform rotate with offset of the center point. Don't know how to do that of the top of my head, but found something that might help here:

Affine transform around a point

于 2012-08-28T13:28:56.820 回答
0

最简单的方法是检测自定义 UIView 的手势,您可以在其中使用 Core Graphics 动态绘制文本区域。您可以在自定义 UIView 中使用以下代码轻松旋转元素:

- (void)drawRect:(CGRect)rect {
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextRotateCTM(context, M_PI / 4);

...

NSString* text = @"Hello";
[text drawAtPoint:point withFont:font];
}
于 2012-08-28T08:12:49.713 回答