【发布时间】:2012-01-20 07:40:35
【问题描述】:
我正在 UIScrollView 上尝试此代码,但它不起作用。 NSLog 没有出现在我的控制台上。怎么了?它不在 UIScrollView 上时工作正常。
- (void)viewDidLoad
{
[super viewDidLoad];
[self papers];
UIGestureRecognizer *recognizer = [[ UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(handleLongPress:)];
longPressGR = (UILongPressGestureRecognizer *)recognizer;
longPressGR.minimumPressDuration = 0.5;
[Image1 addGestureRecognizer:longPressGR];
}
-(void) handleLongPress:(UILongPressGestureRecognizer *)recognizer {
NSLog(@"Long Press");
}
【问题讨论】:
-
这是像课堂作业还是什么的? 2个人问同样的问题哈哈。 stackoverflow.com/questions/8937458/…
-
哈哈!是的,也许你看到了我的朋友拉米罗。我们正在尝试先自己解决。
标签: objective-c ios uiscrollview uigesturerecognizer