0
私はMKPinAnnotationView
を私のアプリケーション内で使用しています。カスタムMKPinAnnotationViewで注釈のタイトルとサブタイトルを表示
私は私required.Howeverとしての私のAnnotationView
func mapView(mapView: MKMapView, viewForAnnotation annotation: MKAnnotation) -> MKAnnotationView? {
if annotation is MKUserLocation {
//return nil so map view draws "blue dot" for standard user location
return nil
}
let reuseId = "pin"
var pinView = mapView.dequeueReusableAnnotationViewWithIdentifier(reuseId) as? MKPinAnnotationView
if pinView == nil {
pinView = MKPinAnnotationView(annotation: annotation, reuseIdentifier: reuseId)
// pinView!.canShowCallout = true
pinView!.image = UIImage(named:"store.jpg")
pinView!.animatesDrop = true
pinView!.pinTintColor = UIColor.darkGrayColor()
}
else {
pinView!.annotation = annotation
}
return pinView
}
私は取得していますカスタムAnnotationViewをカスタマイズするためのデリゲートとしてMapView
オブジェクトを設定し、このコードを使用しています、私はtitle
とMKPointAnnotation
のsubtitle
の機能が不足しています。