本文整理汇总了C#中MKMapView.DeselectAnnotation方法的典型用法代码示例。如果您正苦于以下问题:C# MKMapView.DeselectAnnotation方法的具体用法?C# MKMapView.DeselectAnnotation怎么用?C# MKMapView.DeselectAnnotation使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MKMapView
的用法示例。
在下文中一共展示了MKMapView.DeselectAnnotation方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetViewForAnnotation
/// <summary>
/// This is very much like the GetCell method on the table delegate
/// </summary>
public override MKAnnotationView GetViewForAnnotation (MKMapView mapView, IMKAnnotation annotation)
{
if(ThisIsTheCurrentLocation(mapView, annotation))
{
return null;
}
// try and dequeue the annotation view
MKAnnotationView annotationView = mapView.DequeueReusableAnnotation(annotationIdentifier);
// if we couldn't dequeue one, create a new one
if (annotationView == null)
annotationView = new MKAnnotationView(annotation, annotationIdentifier);
else // if we did dequeue one for reuse, assign the annotation to it
annotationView.Annotation = annotation;
// configure our annotation view properties
annotationView.CanShowCallout = true;
nfloat r;
nfloat g;
nfloat b;
nfloat a;
RandomColorHelper.GetRandomColor().GetRGBA(out r, out g, out b, out a);
if (annotation.GetType () == typeof(HouseMapAnnotation)) {
var rank = (annotation as HouseMapAnnotation).Rank;
var fontSize = rank.Length >= 3 ? 9 : 15;
annotationView.Image = LightMapPointStyleKit.ImageOfLightMapPoint ((float)r, (float)g, (float)b, (float)a, rank, fontSize);
annotationView.Selected = true;
// you can add an accessory view, in this case, we'll add a button on the right, and an image on the left
detailButton = UIButton.FromType(UIButtonType.DetailDisclosure);
detailButton.TintColor = UIColor.Black;
detailButton.TouchUpInside += (s, e) => {
Console.WriteLine ("Clicked");
var detailViewController = UIStoryboard.FromName ("MainStoryboard", null).InstantiateViewController("HouseDetailsViewController") as HouseDetailsViewController;
detailViewController.Annotation = annotation as HouseMapAnnotation;
mapView.DeselectAnnotation(annotation,true);
this.parent.NavigationController.PushViewController(detailViewController,true);
};
annotationView.RightCalloutAccessoryView = detailButton;
FetchImageAsync(annotationView,(annotation as HouseMapAnnotation).House);
}
return annotationView;
}