我有一个uiscrollview,其中包含多个uiimageview,它是这样创建的。
frame = [[UIImageView alloc] initWithImage:bg];
frame.frame = CGRectMake(FRAME_SEPARATOR + numPage*1024 + numColumn*(FRAME_SEPARATOR+230), 10 +numRow*(FRAME_SEPARATOR+145), 230, 145);
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(imageTapped:)];
[frame addGestureRecognizer:tap];
[tap release];
[scroll addSubView:frame];
问题是,当点击图像时,不会调用ImageTapped。
如果我像这样将手势识别器添加到滚动视图中:
UITapGestureRecognizer *tap =
[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(imageTapped:)];
[scroll addGestureRecognizer:tap];
[tap release];
调用ImageTapped。
如何检测uiImageView上的taps?
谢谢