如何将 UIButton 添加到 MKAnnotation (MKView)?

发布于 2024-08-03 22:20:26 字数 219 浏览 3 评论 0原文

我想向 MKAnnotation 添加一个可点击的按钮,如地图应用程序的屏幕截图所示:

预览http://www.img-hosting.de/bilder/24558PlacemarkWithIconpng

I want to add a click able button to a MKAnnotation as seen in this screenshot of the Maps application:

Preview http://www.img-hosting.de/bilder/24558PlacemarkWithIconpng

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

少跟Wǒ拽 2024-08-10 22:20:26
UIButton *disclosureButton = [UIButton buttonWithType: UIButtonTypeDetailDisclosure]; 
annoView.canShowCallout = YES;    
annoView.rightCalloutAccessoryView = disclosureButton;
UIButton *disclosureButton = [UIButton buttonWithType: UIButtonTypeDetailDisclosure]; 
annoView.canShowCallout = YES;    
annoView.rightCalloutAccessoryView = disclosureButton;
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文