1
我在我的主視圖中使用UISwipeGestureRecognizer左,右方向輕掃如下觸摸事件:
UISwipeGestureRecognizer *recognizer1,*recognizer;
recognizer1 = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(handleSwipeFromleft:)];
[recognizer1 setDirection:(UISwipeGestureRecognizerDirectionLeft)];
[self.view addGestureRecognizer:recognizer1];
[recognizer1 release];
recognizer = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(handleSwipeFromright:)];
[recognizer setDirection:(UISwipeGestureRecognizerDirectionRight)];
[self.view addGestureRecognizer:recognizer];
[recognizer release];
,並在此相同的觀點,我也使用像觸摸觸摸事件開始,移動和結束。
兩者都用於不同的目的。
我的問題是,當我觸摸我的視圖並將它從左向右或從右向左移動時; UISwipeGestureRecognizer被稱爲之間的觸摸開始和觸摸移動的方法,我不想要
所以任何人都知道我該如何避免這種類型的東西? 我怎麼可以告訴大家,我現在想用觸摸事件或我使用UISwipeGestureRecognition