如何在C4 ScrollView中的C4图像上获取轻击手势

时间:2013-10-28 02:36:46

标签: c4

我在滚动视图中加载了几张图片 我像这样设置了C4ScrollView:

viewer = [C4ScrollView scrollView:CGRectMake(20, 30, 75, self.canvas.height - 50)];
viewer.contentSize = CGSizeMake(75, 1000);
[self.canvas addSubview:viewer];

然后我将图像放入并添加了点击手势(在for循环中),如下所示:

C4Image* img = [C4Image imgWithUrl:imgUrl];    
[viewer addImage:img];
img.userInteractionEnabled = YES;
[img addGesture:TAP name:@"tap" action:@"tapped"];
[viewer listenFor:@"tapped" fromObject:img andRunMethod:@"imgTap:"];

然后我有一个名为imgTap的方法,如下所示:

-(void)imgTap:(NSNotification *)notification {
    C4Image *img = (C4Image *)notification.object;
    C4Log(@"image tapped");
}

但imgTap:方法永远不会被调用... 难道我做错了什么?或者我是否必须采取不同的措施才能让C4Image识别手势?

0 个答案:

没有答案