Ho un UIScrollView con più UIImageViews in esso creato in questo modo.Rilevamento dei tocchi nella vista panoramica all'interno di 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];
Il problema è che imageTapped non viene chiamato quando si tocca un'immagine.
se aggiungo il sistema di riconoscimento gesto alla ScrollView in questo modo:
UITapGestureRecognizer *tap =
[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(imageTapped:)];
[scroll addGestureRecognizer:tap];
[tap release];
imageTapped si chiama.
Come posso rilevare i tocchi su UIImageViews?
Grazie
Grazie! Questo ha fatto il trucco. – Jorge
+1 Questo era anche il mio problema. Grazie! – AWrightIV
Grazie, ho avuto lo stesso problema. – titaniumdecoy