0
自定義視圖至於我讀的境界文檔在地圖集羣中還有一類ABFClusterAnnotationView
具有幾個特性:count
,color
,countLabel
但我找不到任何地方的註釋image
。這是override
與添加image
屬性?我設法添加images
通過使用默認註釋iside mapView
委託方法,但從那裏我無法管理的羣集計數。我只想在地圖上只有1個值的地方更改圖片。的境界地圖集羣
所以沒有什麼貓膩,簡單設置圖像的註釋:
func mapView(_ mapView: MKMapView, viewFor annotation: MKAnnotation) -> MKAnnotationView? {
let annView = MKAnnotationView(annotation: annotation, reuseIdentifier: "test")
annView.image = myImage
return annView
}
提前感謝!
是啊,那是很酷的答案!但是它不會影響'MyAnnotation',因爲默認情況下所有的註釋都來自Realm庫。 – yerpy