1
我想在MKAnnotationPoint的Callout Bubble中添加一個字幕,該鏈接啓動Safari瀏覽器,最終進入該鏈接。這可能嗎?Annotation Callout字幕可以啓動Safari嗎?
我想在MKAnnotationPoint的Callout Bubble中添加一個字幕,該鏈接啓動Safari瀏覽器,最終進入該鏈接。這可能嗎?Annotation Callout字幕可以啓動Safari嗎?
爲什麼不在泡泡中使用按鈕,這就是爲什麼它被設計用於?
- (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
}
謝謝,我沒有想到它。現在已經很清楚了。 – Hari
很高興我能幫到你 – Spire