【发布时间】:2012-10-04 14:04:21
【问题描述】:
我想为儿童创建一个小型绘图应用程序。我不想实现多点触控绘图应用程序,所以我将绘图视图的 multipleTouchEnabled 设置为 false。
到目前为止,绘图工作正常,但是当孩子用第二根手指触摸视图时,会调用视图的 touchesMoved-eventhandler:
- (void) touchesMoved: (NSSet *) touches withEvent: (UIEvent *)event{
UITouch *touch = [[event allTouches] anyObject];
CGPoint touchPoint = [touch locationInView:self];
//Draw a line from the last touchPoint to here…
}
这样,当孩子用第二根手指触摸屏幕时,会在第一根手指和第二根手指之间画一条线,这是无意的。
有什么办法可以防止这种情况发生吗?
任何帮助将不胜感激
【问题讨论】:
标签: objective-c ios ipad touch