MapKit : Add custom callout

半世苍凉 提交于 2019-12-12 23:04:30

问题


I want to add custom annotationView callout which contains 1. Title 2. subtitles 3. a button

The button can display on the right (rightCalloutAccessoryView) or left leftCalloutAccessoryViewsides of the callout. I want to add the button in the middle of the callout and under title->subtitle. How can I do?


回答1:


There is no API for this. You could try not using the standard callout (canShowCallout = NO), catch the taps and drags on the AnnotationView manually and show your own UI by adding custom Views based on the position of the AnnotationView. This seems very fragile, though.



来源:https://stackoverflow.com/questions/9603482/mapkit-add-custom-callout

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!