MyAnnotation *ann1 = [[MyAnnotation alloc] init];
ann1.coordinate =region.center;
[mapView addAnnotation:ann1];
现在它的紫色我想要红色
答案 0 :(得分:2)
实施MKMapViewDelegate协议回调并将实现类设置为地图视图委托
- (MKAnnotationView *) mapView:(MKMapView *)mapView viewForAnnotation:(id <MKAnnotation>) annotation {
MKPinAnnotationView *newAnnotationPin = [[[MKPinAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:@"simpleAnnotation"] autorelease];
newAnnotationPin.pinColor = MKPinAnnotationColorRed; // Or Red/Green
return newAnnotation;
}