草庐IT

touchesFinished

全部标签

iphone - iOS 失去联系?

我找不到任何内容来解释丢失的UITouch事件。如果您用整只手在屏幕上敲打的次数足够多,touchesBegan的数量将不同于touchesEnded的数量!我认为真正了解这些孤立触摸的唯一方法是自己引用它们并跟踪它们多久没有移动。示例代码:inttouchesStarted=0;inttouchesFinished=0;-(void)touchesBegan:(NSSet*)toucheswithEvent:(UIEvent*)event{touchesStarted+=touches.count;}-(void)touchesEnded:(NSSet*)toucheswithEve