【发布时间】:2014-07-23 09:07:48
【问题描述】:
我正在使用来自 John-Lluch 的 SWRevealViewController。我需要使用平移手势来查看侧边栏,并且我正在使用滑动来查看我的上一篇和下一篇文章。但是,只能检测到平移手势。
更新:如果我禁用平移手势,我的滑动手势会起作用。
平移手势
[self.view addGestureRecognizer:self.revealViewController.panGestureRecognizer];
滑动手势
UISwipeGestureRecognizer *left = [[[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(swipeLeft:)] autorelease];
left.direction = UISwipeGestureRecognizerDirectionLeft;
UISwipeGestureRecognizer *right = [[[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(swipeRight:)] autorelease];
right.direction = UISwipeGestureRecognizerDirectionRight;
[self.view addGestureRecognizer:left];
[self.view addGestureRecognizer:right];
【问题讨论】:
-
添加更多代码或细节以帮助解释您使用滑动手势识别器的原因...
-
我在 SWRevealViewController 中没有问题,请检查您的滑动手势
-
为什么不使用它:
-(IBAction) SwipeMe : (UISwipeGestureRecognizer *) recognizer{ NSLog(@"swiped"); }只需将其链接到您的视图即可。 -
@Watsche 如果我禁用平移手势,我的滑动手势会起作用。
-
@NKB 我已经在我的内容中解释过了。 pan是打开侧边栏,滑动阅读文章。
标签: ios iphone uipangesturerecognizer uiswipegesturerecognizer