当我单击红色图钉时,我想获得详细信息披露按钮。
- (MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id<MKAnnotation>)annotation {
static NSString *identifier = @"RoutePinAnnotation";
if ([annotation isKindOfClass:[UICRouteAnnotation class]]) {
pinAnnotation = (MKPinAnnotationView *)[mapView dequeueReusableAnnotationViewWithIdentifier:@"pinAnnotation"];
if(!pinAnnotation) {
NSLog(@"entered");
pinAnnotation = [[[MKPinAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:@"pinAnnotation"] autorelease];
pinAnnotation.canShowCallout = YES;
pinAnnotation.pinColor = MKPinAnnotationColorGreen;
rightButton = [UIButton buttonWithType:UIButtonTypeDetailDisclosure];
pinAnnotation.rightCalloutAccessoryView = rightButton;
}
}
我使用此代码获取两个位置(绿色引脚)和中点的详细信息披露按钮。