0

绘制时是否有任何函数或算法可以捕捉所有点iPhone?就像在 Android 中一样,我们有鬼神论点。

4

1 回答 1

0

检查方法touchesBegan:withEvent:touchesMoved:withEvent:touchesEnded:withEvent:touchesCancelled:withEvent:检测运动

例如使用方法 -touchesMoved:withEvent:

- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event
{
    UITouch *touch = [touches anyObject];
    CGPoint currentPosition = [touch locationInView:self.view];
    NSLog(@"%@", NSStringFromCGPoint(currentPosition));
}

有关更多信息,请查看UIResponder 类的文档

于 2013-03-15T09:02:27.223 回答