如何告诉rightCalloutAccessoryView已为MapKit感动 [英] How to tell a rightCalloutAccessoryView has been touched for MapKit

查看:59
本文介绍了如何告诉rightCalloutAccessoryView已为MapKit感动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我分配了一个MKAnnotationView,并在其右侧显示了DetailDisclosure按钮.我如何知道用户何时单击注释按钮?这就是我的代码现在的样子-

I have a MKAnnotationView being allocated with a DetailDisclosure button being displayed on the right side of the annotation. How would I go about knowing when a user clicked on the annotation button? This is what my code looks like right now -

UIButton *rightButton = [UIButton buttonWithType:UIButtonTypeDetailDisclosure];
pinView.rightCalloutAccessoryView = rightButton;
pinView.animatesDrop = YES;

是否有内置方法来检测何时触摸了附件视图?我猜想它就像UITableView方法,但我找不到任何东西.感谢您的帮助.

Is there a built in method to detect when a accessory view has been touched? I'm guessing it would be like the UITableView methods, but I can't find anything. Thanks for any help.

推荐答案

您需要将一些对象设置为地图视图的delegate,并实现MKMapViewDelegate协议方法-mapView:annotationView:calloutAccessoryControlTapped:.

You need some object to be set as your map view's delegate, and implement the MKMapViewDelegate protocol method -mapView:annotationView:calloutAccessoryControlTapped:.

这篇关于如何告诉rightCalloutAccessoryView已为MapKit感动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆