草庐IT

TouchesMoved

全部标签

ios - touchesBegan 和 touchesMoved 没有在 UIView 上触发

我想要实现的目标:尝试抓取屏幕上当前触摸区域的坐标,并将接收到的坐标绘制到屏幕上。简而言之,一个基本的绘图应用程序,全部以编程方式编写(用于我自己的练习)。问题PaintingSubclass的touchesBegan和touchesMoved根本没有被调用。当前设置我有一个PaintingViewController然后我还有一个PaintingSubclass。PaintingViewController是一个UIViewController而PaintingSubclass是一个UIView。PaintingViewController创建一个PaintingSubclass的实

ios - 为什么 UIViewController touchesBegan、touchesMoved 和 touchesEnded 仅在两个触摸中的第一个开始、移动或结束时才被调用?

我在通过UIViewController的touchesBegan/Moved/Ended方法处理多个触摸时遇到问题。我也在cocos2d应用程序(使用ccTouchesBegan/Moved/Ended)中看到了相同的行为,所以我认为这个问题可以应用于iOS中的所有触摸处理。我将我正在使用的代码放在下面,然后是我看到的结果。所有方法都在UIViewController子类上实现。-(void)touchesBegan:(NSSet*)toucheswithEvent:(UIEvent*)event{NSLog(@"TouchesBegan");[selflogTouchesFor:e