我用这段代码改变了注释的颜色,但是之后标题和副标题无法显示,我该如何保存这个问题?
代码是:
- (MKAnnotationView *)mapView:(MKMapView *)mV viewForAnnotation:(id <MKAnnotation>)annotation
{
static NSString *defaultPinID = @"LYB";
MKPinAnnotationView *customPinview = (MKPinAnnotationView *)[_mapView dequeueReusableAnnotationViewWithIdentifier:defaultPinID];
if ( customPinview == nil ) {
customPinview = [[[MKPinAnnotationView alloc]
initWithAnnotation:from reuseIdentifier:defaultPinID] autorelease];
}
if ([annotation isKindOfClass:[MKUserLocation class]])
return nil;
if ([[annotation title] isEqualToString:@"the first"]) {
customPinview.pinColor = MKPinAnnotationColorGreen;
}
return customPinview;
}