0

我想通过在屏幕上移动手指来在屏幕上绘图。

我们如何在 iPhone SDK 中实现这一点?

4

1 回答 1

1

您首先需要实现UIResponder链中的触摸感应方法。您需要实现的方法是

- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event

在此方法中,您可以使用 Core Graphics 绘图方法来绘制自定义绘图。教程将引导您完成这些步骤。

于 2011-04-29T09:36:03.113 回答