使用自定义注释时,MapKit蓝点不可见

use*_*835 3 iphone maps annotations mapkit

当我使用自定义注释时,我无法看到蓝色当前位置点

- (MKAnnotationView *) mapView:(MKMapView *) mapView viewForAnnotation:(id<MKAnnotation> ) annotation {

    MKAnnotationView *customAnnotationView=[[[MKAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:nil] autorelease];

    UIImage *pinImage = [UIImage imageNamed:@"ann.png"];
    [customAnnotationView setImage:pinImage];

    customAnnotationView.canShowCallout = YES;
                                                                                                 
    //UIImageView *leftIconView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"ann.png"]];
    //customAnnotationView.leftCalloutAccessoryView = leftIconView;

    UIButton *rightButton = [UIButton buttonWithType:UIButtonTypeDetailDisclosure];
    [rightButton addTarget:self action:@selector(showDetails:) forControlEvents:UIControlEventTouchUpInside];
    customAnnotationView.rightCalloutAccessoryView = rightButton;

    return customAnnotationView;
}
Run Code Online (Sandbox Code Playgroud)

Ale*_*nte 8

if (annotation == map.userLocation) {
        return nil;
    }
Run Code Online (Sandbox Code Playgroud)

添加这个.:d