作者热门文章
- android - RelativeLayout 背景可绘制重叠内容
- android - 如何链接 cpufeatures lib 以获取 native android 库?
- java - OnItemClickListener 不起作用,但 OnLongItemClickListener 在自定义 ListView 中起作用
- java - Android 文件转字符串
有人知道为什么我不能强制 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)的实现。
最佳答案
detailDisclosure type 和 infoLight/infoDark 的按钮图像相同。
关于ios - MKAnnotationView 总是显示 infoButton 而不是 detailDisclosure btn,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22012468/
有人知道为什么我不能强制 mapView 标注使用 detailDisclosureBtn 而不是 infoButton 吗? - (MKAnnotationView *)mapView:(MKMap
我是一名优秀的程序员,十分优秀!