J'ai créé un UIScrollView avec plusieurs UIImageViews créés comme ceci.Détection des taps dans uiimageview à l'intérieur de uiscrollview
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];
Le problème est que l'imageTapped n'est pas appelée lorsque vous tapotez sur une image.
Si j'ajouter le geste de reconnaissance à l'scrollview comme ceci:
UITapGestureRecognizer *tap =
[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(imageTapped:)];
[scroll addGestureRecognizer:tap];
[tap release];
imageTapped est appelé. Comment est-ce que je peux détecter les robinets sur les UIImageViews?
Merci
Merci! Cela a fait l'affaire. – Jorge
+1 C'était aussi mon problème. Merci! – AWrightIV
Merci, j'ai eu le même problème. – titaniumdecoy