开发者

problem with swip gesture recognizers in iOS

I am using the following code :

UISwipeGestureRecognizer *swipeRecognizer = 
   [[UISwipeGestureRecognizer alloc]
   initWithTarget:self 
   action:@selector(swipeDetected:)];
swipeRecognizer.direction = UISwipeGestureRecognizerDirectionRight;
[self.view addGestureRecognizer:swipeRecognizer];
[swipeRecognizer release];

And,

- (void)swipeDetected:(UIGestureRecognizer *)sender {
NSLog(@"R开发者_JAVA百科ight Swipe");
}

But I dont see any output when I swipe in the simulator. Can anyone please help me out ? Thanks.


Since you have a UITableView, it may be blocking the action. Try adding the swipeGesture directly to the tableView.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜