【发布时间】:2014-05-18 12:52:35
【问题描述】:
我在myViewController 上有一个名为myView 的UIView。我有一个名为swipeLeft(下面的代码)的 UIGestureRecognizer,它可以检测用户何时向左滑动。
问题是:myViewController 在整个屏幕上识别出相同的手势并执行另一个动作。所以我希望我的应用程序在swipeLeft 这个特定区域myViewController 中执行myMethod,该区域为myView。
UISwipeGestureRecognizer *swipeLeft = [[UISwipeGestureRecognizer alloc] initWithTarget:self
action:@selector(myMethod:)];
swipeLeft.direction = UISwipeGestureRecognizerDirectionLeft;
swipeLeft.delaysTouchesBegan = YES;
[self.myView addGestureRecognizer:swipeLeft];
更多细节:我使用的是RESideMenu,而myViewController是正确的菜单,所以当它可见时,myViewController的整个视图可以识别各个方向的滑动。我想在这个特定的 UIView myView 中更改识别器。
谢谢!
【问题讨论】:
标签: ios uiview uigesturerecognizer gesture-recognition