Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/93.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Objective c iOS核心绘图-检测图形上的滑动手势_Objective C_Ios_Core Plot_Gesture_Uiswipegesturerecognizer - Fatal编程技术网

Objective c iOS核心绘图-检测图形上的滑动手势

Objective c iOS核心绘图-检测图形上的滑动手势,objective-c,ios,core-plot,gesture,uiswipegesturerecognizer,Objective C,Ios,Core Plot,Gesture,Uiswipegesturerecognizer,我使用Core Plot显示散点图,我想使用滑动手势在图本身和组成图的数据的UITableView之间切换。我的UISweepGestureRecognitor在表视图上工作正常,但在图形上不会触发滑动事件。该图形是一个UIView,类设置为CPTGraphHostingView,我的代码如下: UISwipeGestureRecognizer *swipeRight = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@

我使用Core Plot显示散点图,我想使用滑动手势在图本身和组成图的数据的UITableView之间切换。我的UISweepGestureRecognitor在表视图上工作正常,但在图形上不会触发滑动事件。该图形是一个UIView,类设置为CPTGraphHostingView,我的代码如下:

UISwipeGestureRecognizer *swipeRight = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(swipeHistoryData:)];
[swipeRight setDirection:UISwipeGestureRecognizerDirectionRight];
[graphHostingView addGestureRecognizer:swipeRight];
[tableListView addGestureRecognizer:swipeRight];

我猜CPTGraphHostingView正在以某种方式“吃掉”刷卡,因此我的识别器不会检测到它们。有人能给我点评或指正吗?

对不起,我刚刚弄明白了-我在图形视图和表格视图中添加了相同的手势识别器。我总是忘记这不起作用-因为它是在图表视图之后添加到表视图的,只有表视图接收事件。我需要使用2个手势识别器,除非有人能告诉我不同。

graphHostingView是否设置了用户交互属性?我认为如果设置了图形视图的用户交互启用,它将识别手势。用户交互启用正常。只是一个手势识别器在任何时候只能连接到一个视图控件。我需要使用2个识别器。是否将图形视图添加到表视图中?在图形视图上滑动时,是否希望表视图和图形都检测到滑动手势?你真正想要的是什么?我已经解决了我的问题,感谢使用一个单独的图形和表格识别器。我刚刚更新了上面的代码,以显示我使用的完整代码。我忘记了识别器只能连接到一个视图,因此在上面的代码中,它首先被设置为图形,然后被移动到表中,以便图形不再触发手势事件。