【发布时间】:2014-03-04 05:18:31
【问题描述】:
在我的项目中,我需要一个左右移动的滑动手势动作,我需要一个上下方向的平移手势动作。当我同时使用两个手势时,只有平移手势在调用。有人对此有解决方案吗?
UISwipeGestureRecognizer *rightSwipe = [[UISwipeGestureRecognizer alloc]initWithTarget:self action:@selector(goToPreviosSong)];
rightSwipe.direction = UISwipeGestureRecognizerDirectionRight;
[self.view addGestureRecognizer:rightSwipe];
UISwipeGestureRecognizer *leftSwipe = [[UISwipeGestureRecognizer alloc]initWithTarget:self action:@selector(goToNextSong)];
rightSwipe.direction = UISwipeGestureRecognizerDirectionLeft;
[self.view addGestureRecognizer:leftSwipe];
对于 pan 我正在使用此代码
UIPanGestureRecognizer *panGesture = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(panAction:)];
[self.view addGestureRecognizer:edgePanGesture];
【问题讨论】:
标签: ios iphone objective-c ios7