简体   繁体   English

MapKit中调用的此灰色弹出窗口到底是什么?点击时会调用什么方法?

[英]What exactly is this grey colored popup called in MapKit & what method gets called when tapped?

Ok I have this mapview with location pins, 5 shown here: 好的,我有带有定位销的mapview,这里显示了5个:

地图图钉位置

But what is the grey popup that shows up when you tap a pin, called? 但是,当您点击名为的别针时,会显示什么灰色弹出窗口?

And what method gets called when you tap on the pin, that contains or fetches the pin data to be displayed on that grey call out? 当您点击图钉时,包含或获取要在该灰色标注上显示的图钉数据的哪种方法会被调用?

They're called callouts, and - (MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id <MKAnnotation>)annotation is called when a pin is tapped. 它们被称为标注,并且- (MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id <MKAnnotation>)annotation会调用- (MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id <MKAnnotation>)annotation To see how to use them, I recommend this tutorial: http://www.raywenderlich.com/21365/introduction-to-mapkit-in-ios-6-tutorial 要了解如何使用它们,我建议使用本教程: http : //www.raywenderlich.com/21365/introduction-to-mapkit-in-ios-6-tutorial

It's a private class and, as mentioned, is called an annotation callout. 这是一个私有类,如上所述,它称为注释标注。 Check out https://github.com/nfarina/calloutview for an open source clone of it and http://www.mapbox.com/mapbox-ios-sdk/ for an open source clone of MapKit that uses it natively. 请查看https://github.com/nfarina/calloutview以获得它的开放源代码副本,以及http://www.mapbox.com/mapbox-ios-sdk/获得可以本地使用它的MapKit的开放源代码副本。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM