0
有一種方法只能在特定項目上劃過滑動界限?Delimit UISwipeGestureRecognizer
這樣它的工作原理無處不在
UIGestureRecognizer *recognizer;
//RIGHT
recognizer = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(swipeRight:)];
self.swipeRightRecognizer =(UISwipeGestureRecognizer *)recognizer;
swipeRightRecognizer.direction = UISwipeGestureRecognizerDirectionRight;
[self.view addGestureRecognizer:swipeRightRecognizer];
self.swipeRightRecognizer = (UISwipeGestureRecognizer *)recognizer;
[recognizer release];
的感謝!
謝謝,但一切工作。你寫我可以將滑動識別器添加到我想要滑動的視圖中,怎麼樣? 謝謝 – Vins
而不是'[self.view addGestureRecognizer:...]'只需使用[myViewThatShouldReceiveSwipes addGestureRecognizer:...]'。 – jtbandes