UILabel CreateLabel(NinjaAnnotation annotation) { var label = new UILabel(new RectangleF(-10, 27, 80, 40)) { BackgroundColor = UIColor.Clear, TextColor = UIColor.Black, ShadowColor = UIColor.White, AdjustsFontSizeToFitWidth = true, Tag = LabelPinSubView, Font = UIFont.BoldSystemFontOfSize(14), Text = annotation.Title }; return label; }
MKAnnotationView CreatePushPin(NinjaAnnotation annotation) { const string reuseIdentifier = "NinjaPushPin"; var view = _mapView.DequeueReusableAnnotation(reuseIdentifier) as MKPinAnnotationView; if (view != null) return view; view = new MKPinAnnotationView(annotation, reuseIdentifier) { PinColor = MKPinAnnotationColor.Purple, AnimatesDrop = true }; view.AddSubview(CreateLabel(annotation)); return view; }