2013-08-14 4 views

답변

0

주석 뷰의 모양을 정의하는 방법이있다 같은 :

-(MKAnnotationView *)mapView:(MKMapView *)mV viewForAnnotation:(id<MKAnnotation>)annotation 
{ 
    MKPinAnnotationView *pinView = nil; 
    if(annotation != mapView.userLocation) 
    { 
     pinView = (MKPinAnnotationView *)[mapView dequeueReusableAnnotationViewWithIdentifier:@"pinID"]; 

     if (pinView == nil) 
     { 
      pinView = [[MKPinAnnotationView alloc] initWithAnnotation:annotation 
                 reuseIdentifier:defaultPinID]; 
     } 

     pinView.canShowCallout = YES; 
     pinView.animatesDrop = YES; 

     . . . 

     // ----------------------------------- 
     // Add extra subviews here 
     // ----------------------------------- 
     UILabel *lblNumbers = [[UILabel alloc] init...]; 

     lblNumbers.text = ....; 
     lblNumbers.backgroundColor = [UIColor colorWithRed:0.1 Green:0.1 Blue:0.1]; 

     // add the subview to the pinView 
     [pinView addSubview:lblNumbers]; 
    } 

    return pinView; 
} 
관련 문제