CalloutAccessoryView view for MKPinAnnotationView

…衆ロ難τιáo~ 提交于 2019-12-14 03:22:28

问题


We have rightCalloutAccessoryView and leftCalloutAccessoryView for MKPinAnnotationView

but is there if we need to add a custom button to the entire popup bubble how to add it

the main requirement is i need to perform same action when we tap on Popup bubble just like disclser Button action.

//To add a discloser button to show route map
inView = (MKPinAnnotationView *)[mapView dequeueReusableAnnotationViewWithIdentifier:defaultPinID];
        UIButton *detailBtn=[UIButton buttonWithType:UIButtonTypeDetailDisclosure];
        pinView.rightCalloutAccessoryView=detailBtn;
        [detailBtn addTarget:self action:@selector(showRoute:) forControlEvents:UIControlEventTouchUpInside];

How add a custom button to this popup buble


回答1:


for putting custom button on whole mapcallout you need to add custom mapcalloutview so search for that in google there were class available for the custom callout view and this way you can create your customcallout with your custom view and button.



来源:https://stackoverflow.com/questions/18311193/calloutaccessoryview-view-for-mkpinannotationview

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