UIPanGesture 选择器方法在 iPhone sdk(iOS 5.1) 中未调用



我正在尝试使用UIPanGesture来显示我的一个视图。不幸的是,该 UIPanGesture 的选择器方法没有触发。

这是我的代码:

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

这是我的选择器方法:

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

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

感谢大家,莫尼什。

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

最新更新