【问题标题】:How to draw on screen using hand gestures in iPhone SDK?如何在 iPhone SDK 中使用手势在屏幕上绘图?
【发布时间】:2011-04-29 09:09:16
【问题描述】:

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

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

【问题讨论】:

    标签: ios cocoa-touch ios4 uitouch custom-draw


    【解决方案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 绘图方法来绘制自定义绘图。 This 教程将引导您完成这些步骤。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-03-08
      • 2023-03-03
      • 1970-01-01
      • 1970-01-01
      • 2010-11-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多