2009-07-31 15 views
0

gibt es ein .png Bild, das menschliche Körperskelett anzeigt. Meine Abfrage ist, dass, wie man verschiedene Teile des Skeletts wie Hand, Fuß, Kopf usw. im Bild vorwählt und dann nach Auswahlsteuerung bewegt in eine andere Ansicht, die Informationen zu diesem ausgewählten Teil anzeigt.wie man verschiedene Teile eines Bildes auswählen

Antwort

0

ich wahrscheinlich UIImageView Unterklasse würde und überschreiben touchesEnded: withevent:

- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event 
{ 
    // ignore if more than one finger 
    if ([touches count] != 1) { 
     [self.nextResponder touchesEnded:touches withEvent:event]; 
     return; 
    } 

    UITouch *touch = [touches anyObject]; // there's only one object in the set 

    // ignore unless the user lifted the finger off the screen 
    if (touch.phase != UITouchPhaseEnded) { 
     [self.nextResponder touchesEnded:touches withEvent:event]; 
     return; 
    } 

    // ignore if double-touch or more 
    if ([touch tapCount] != 1) { 
     [self.nextResponder touchesEnded:touches withEvent:event]; 
     return; 
    } 

    CGPoint locationOfTouch = [touch locationInView:self]; 

    // TODO: use locationOfTouch.x and locationOfTouch.y to determine which part has been selected 
} 
Verwandte Themen