有人知道为什么我不能强制mapView标注使用detailDisclosureBtn而不是infoButton?
- (MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id <MKAnnotation>)annotation { static NSString *identifier = @"HPIPAnnotation"; if ([annotation isKindOfClass:[CoreCityAnnotation class]]) { MKPinAnnotationView *annotationView = (MKPinAnnotationView *) [_mapView dequeueReusableAnnotationViewWithIdentifier:identifier]; if (annotationView == nil) { annotationView = [[MKPinAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:identifier]; } else { annotationView.annotation = annotation; } UIButton *disclosureButton = [UIButton buttonWithType:UIButtonTypeDetailDisclosure]; annotationView.canShowCallout = YES; annotationView.animatesDrop = YES; annotationView.rightCalloutAccessoryView = disclosureButton; return annotationView; } return nil; }
那是我对代表的实现.
解决方法
detailDisclosure类型和infoLight / infoDark的按钮图像是相同的.