gpt4 book ai didi

ios - MKAnnotationView 总是显示 infoButton 而不是 detailDisclosure btn

转载 作者:可可西里 更新时间:2023-11-01 05:35:28 24 4
gpt4 key购买 nike

有人知道为什么我不能强制 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;
}

这就是我对委托(delegate)的实现。

最佳答案

关于ios - MKAnnotationView 总是显示 infoButton 而不是 detailDisclosure btn,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22012468/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com