我想在MKAnnotationPoint的Callout Bubble中添加一个副标题,这个链接会启动最终进入该链接的Safari浏览器。这可能吗?
答案 0 :(得分:4)
为什么不在气泡中使用按钮,这就是它的设计原因?
- (MKAnnotationView *) mapView:(MKMapView *)mapView viewForAnnotation:(id <MKAnnotation>) annotation{
MKPinAnnotationView *annView=[[MKPinAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:@"currentloc"];
annView.pinColor = MKPinAnnotationColorGreen;
annView.animatesDrop=TRUE;
annView.canShowCallout = YES;
annView.calloutOffset = CGPointMake(-5, 5);
annotationButton = [UIButton buttonWithType:UIButtonTypeDetailDisclosure];
[annotationButton addTarget:self action:@selector(annotationAction) forControlEvents:UIControlEventTouchUpInside];
annView.rightCalloutAccessoryView = annotationButton;
return annView;
}
- (void) annotationAction {
//Call a web view here
}