的情况是这样 我有一个UIImageView
说imvObj在一个UIView说vwObj这整个设置是UITableViewCell
内。我在vwObj上添加了UIPanGestureRecognizer
。这件东西很好用iOS
< 5.0。 请帮忙。UIPanGestureRecognizer不是在iOS5的工作
编辑
UIPanGestureRecognizer *panGesture = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(someOtherMethod:)];
[panGesture setDelegate:self];
[panGesture setMaximumNumberOfTouches:1];
[vwObj addGestureRecognizer:panGesture];
[panGesture release];
解决方案
只是删除以下行,问题得到了解决
[panGesture setDelegate:self];
这是不够的信息。仅添加UIPanGestureRecognizer是不够的;它本身并没有做任何事情。你必须有一个动作处理程序来响应手势识别器。解释如何设置,显示代码,并清楚说明什么是不工作的。 – matt 2011-12-16 16:50:30