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