开发者

Show callout bubble without user interaction

开发者 https://www.devze.com 2022-12-28 01:21 出处:网络
How to show cal开发者_JAVA技巧lout bubble without the user tapping on the pin ??(Assuming you\'re talking about annotations on MKMapView)

How to show cal开发者_JAVA技巧lout bubble without the user tapping on the pin ??


(Assuming you're talking about annotations on MKMapView)

Call [mapView selectAnnotation:yourAnnotation animated:YES]; with your annotation object


It can be done as Vladimir said, but I think you need to do it after the MKAnnotationView related to your annotation is shown.

You can use the method below (which is a method defined in MKMapViewDelegate) to get informed when an annotation view is added to your MKMapView:

-(void) mapView:(MKMapView *)mapView didAddAnnotationViews:(NSArray *)views

So, basically you need to invoke the method mentioned by Vladimir

[mapView selectAnnotation:yourAnnotation animated:YES];

in the implementation of the delegate method I mentioned above

0

精彩评论

暂无评论...
验证码 换一张
取 消