UIPanGestureRecognizer不能在iOS5上工作



情况是这样的我有一个UIImageViewimvObj在UIView说vwObj这整个设置是在一个UITableViewCell。我在vwObj上添加了UIPanGestureRecognizer。这个东西在iOS上工作得很好;5.0 。请帮助。

编辑

    UIPanGestureRecognizer *panGesture = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(someOtherMethod:)];
    [panGesture setDelegate:self];
    [panGesture setMaximumNumberOfTouches:1];
    [vwObj addGestureRecognizer:panGesture];
    [panGesture release];
<<p> 解决方案/strong>

刚删除下一行,问题已解决

    [panGesture setDelegate:self];

我想你只是忘了为imageview启用userInteraction。

imageView.userInteractionEnabled = YES;

终于得到了答案。我做错了一件事,我在把目标设为self后设置了gesture的委托。下面一行在iOS5

中导致了这个问题
[panGesture setDelegate:self];

最新更新