UIPangestureRecognizer

UIPangestureRecognizer

情况就是这样
我在UIView中用UIImageView说imvObj说vwObj,整个设置在UITableViewCell内部。我在vwObj上添加了UIPanGestureRecognizer。这个东西在iOS 请帮忙。

编辑

    UIPanGestureRecognizer *panGesture = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(someOtherMethod:)];
    [panGesture setDelegate:self];
    [panGesture setMaximumNumberOfTouches:1];
    [vwObj addGestureRecognizer:panGesture];
    [panGesture release];




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

    [panGesture setDelegate:self];

最佳答案

我认为您只是忘记为imageview启用userInteraction了。

imageView.userInteractionEnabled = YES;

关于iphone - UIPanGestureRecognizer在iOS5上不起作用,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/8535958/

10-13 05:34