0
我用我的应用程序的代码来识别特定的UIView
触摸和拖拽,的touchesBegan和touchesMoved卡
现在我有一个问题,如果我使触摸和直接使一个拖动touchesMoved
只有3-称为4次,然后停止,然后调用touchesCancelled
,但是如果我触摸屏幕等待一秒钟,然后每次手指移动时拖动它拨打touchesMoved
。
编辑
Ijust测试了iPhone 4S的,并与该设备它的工作完美,在ipod4它仍然有问题。这两个设备都是5.01。
-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{
NSArray* touchArray = [touches allObjects];
UITouch* touch = [touchArray objectAtIndex:0];
CGPoint point = [touch locationInView:self.view];
UIView *tmp = [self.view hitTest:point withEvent:event];
if (tmp == volumeViewBackground) {
//do something
}else {
NSLog(@"err");
}
}
-(void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event{
NSArray* touchArray = [touches allObjects];
UITouch* touch = [touchArray objectAtIndex:0];
CGPoint point = [touch locationInView:self.view];
UIView *tmp = [self.view hitTest:point withEvent:event];
if (tmp == volumeViewBackground) {
//do something
}else {
NSLog(@"err");
}
}
-(void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event{
NSLog(@"error");
}
这里没有足够的代码来显示导致问题的原因。 – colbadhombre 2012-02-19 15:44:48