2
このコードを使用して注釈の色を変更しましたが、その後にタイトルとサブタイトルを表示できません。ピンチカラーを変更した後に注釈のタイトルを表示することはできません
コードは以下のとおりです。
- (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;
}