小编use*_*835的帖子

使用自定义注释时,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)

iphone maps annotations mapkit

3
推荐指数
1
解决办法
2351
查看次数

标签 统计

annotations ×1

iphone ×1

mapkit ×1

maps ×1