0

我正在尝试将 UIPanGesture 用于我的观点之一。不幸的是,该 UIPanGesture 的选择器方法没有触发。

这是我的代码:

 UIPanGestureRecognizer * panRecognizer = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(handleTransactionPan:)];
    [self.graphView addGestureRecognizer:panRecognizer];

这是我的选择器方法:

-(void)handleTransactionPan:(UIPanGestureRecognizer*)recognizer 
{
    NSLog(@"\n Inside Pan Gesture.....");
}

朋友们请向我提出你的想法,我在这里做错了。

谢谢大家,莫尼什。

4

1 回答 1

0

尝试这个 UIPanGestureRecognizer * panRecognizer = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(handleTransactionPan:)]; [self.graphView setUserInteractionEnabled:YES]; [self.graphView addGestureRecognizer:panRecognizer];

于 2012-04-22T06:28:23.417 回答