2012-04-22 36 views
0

我想使用UIPanGesture到我的一个视图。不幸的是,该UIPanGesture的选择器方法没有触发。UIPanGesture选择器方法没有在iPhone SDK(iOS 5.1)中调用

这里我的代码:

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

这是我的选择方法:

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

朋友请与乌尔想法重量的错我在这里给我建议。

谢谢大家, Monish。

回答

0

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

+0

是它的工作就像魅力.. Tanq .. +1 – 2012-04-22 16:29:07

相关问题