当我点击红色引脚时,我想得到详细的披露按钮,例如:看图像

时间:2013-06-17 06:19:28

标签: iphone ios annotations mkmapview mkannotation

enter image description here

当我点击红色图钉时,我想获得详细信息披露按钮。

- (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;

          }
    }

我使用此代码获取两个位置(绿色图钉)和中点的详细信息披露按钮。

0 个答案:

没有答案