草庐IT

MKClusterAnnotation

全部标签

swift - 为 MKClusterAnnotation 设置 MKMarkerAnnotationView 的 glyphText

我有一个实现MKAnnotation协议(protocol)的MapItem类。我正在使用MKMarkerAnnotationView在map上显示注释。根据文档,MKMarkerAnnotationView的glyphText属性设置为nil时,它会在标记上生成图钉图像。当对注释进行聚类时,我想要在标记上使用相同的图钉图像。但系统默认情况下将其设置为聚类在此群集中的注释数。我什至尝试将此属性设置为nil,但没有任何效果。funcmapView(_mapView:MKMapView,viewForannotation:MKAnnotation)->MKAnnotationView?{i