我希望能够让手势识别器在屏幕上的任何位置听两个手指轻扫.
现在我在一个子视图中有一个UITableView,当然滚动,它似乎没有拿起我在视图上设置的UIGestureRecognizer.当你使用两个手指时,它只是滚动...
有没有办法制作整个视图,可能是超级视图,听两个手指触摸,当它识别它时,它将不是滚动表视图,做我想要它做什么?
编辑:继承我的代码,但这是一个非常笼统的问题.我只是希望能够在整个视图中使用UIGestureRecognizer,整个过程.
navBarTitle.title = @"Crunch";
//opening the menuView from launch
//setup the customtable view as a subview in menuView
SDMenuViewController *mvc = [[[SDMenuViewController alloc] initWithNibName:@"SDNestedTableView" bundle:nil] autorelease];
[self addChildViewController:mvc];
[mvc didMoveToParentViewController:self];
[menuView addSubview:mvc.view];
[mvc.view setFrame:CGRectMake(mvc.view.frame.origin.x, mvc.view.frame.origin.y, mvc.view.frame.size.width, mvc.view.frame.size.height + 44)]; //add navBarHeight, for some strage reason
//add swipe down gesture on for the menu
UISwipeGestureRecognizer *swipeClose =[[[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(closeMenu)] autorelease];
swipeClose.numberOfTouchesRequired = 2;
swipeClose.direction = UISwipeGestureRecognizerDirectionUp;
UISwipeGestureRecognizer *swipeOpen = [[[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(openMenu)] autorelease];
swipeOpen.numberOfTouchesRequired = …Run Code Online (Sandbox Code Playgroud) 我正在尝试检测视图上的双击,但是当双击时,第一次点击触发TouchesBegan上的动作,因此,在检测到双击之前,始终首先检测到单击.
如何才能检测到双击?
我不能使用OS 3.x手势,因为我必须使它与旧操作系统版本兼容.
谢谢