我对 MapKit 实现非常陌生
在我的应用程序中,一页是地图视图
因为我已经显示了大量的引脚及其注释操作。
我在这些披露按钮上添加了一个披露按钮,popup bubble
并为这些披露按钮设置操作,如下所示。
i Want to Same action When tap on that gray bubble
//To add a discloser button to show route map
UIButton *detailBtn=[UIButton buttonWithType:UIButtonTypeDetailDisclosure];
pinView.rightCalloutAccessoryView=detailBtn;
[detailBtn addTarget:self action:@selector(showRoute:) forControlEvents:UIControlEventTouchUpInside];
DisplayMap *ann=(DisplayMap *)annotation;
detailBtn.tag = ann.detailButtonTag;
//viewForAnnotation DELEGATE for annotions
-(MKAnnotationView *)mapView:(MKMapView *)mV viewForAnnotation:
(id <MKAnnotation>)annotation {
MKPinAnnotationView *pinView = nil;
if(annotation != mapView.userLocation)
{
static NSString *defaultPinID = @"com.invasivecode.pin";
pinView = (MKPinAnnotationView *)[mapView dequeueReusableAnnotationViewWithIdentifier:defaultPinID];
if ( pinView == nil ) pinView = [[MKPinAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:defaultPinID] ;
pinView.pinColor = MKPinAnnotationColorRed;
pinView.canShowCallout = YES;
pinView.animatesDrop = YES;
//To add a discloser button to show route map
UIButton *detailBtn=[UIButton buttonWithType:UIButtonTypeDetailDisclosure];
pinView.rightCalloutAccessoryView=detailBtn;
[detailBtn addTarget:self action:@selector(showRoute:) forControlEvents:UIControlEventTouchUpInside];
DisplayMap *ann=(DisplayMap *)annotation;
detailBtn.tag = ann.detailButtonTag;
}
else
{
[mapView.userLocation setTitle:@"I am here"];
}
return pinView;
}
但我想在点击那个灰色气泡时采取同样的行动..
怎么做