`

MKMapView 如何让地图的anotation的callout自动显示

    博客分类:
  • iOS
 
阅读更多

我是这么来实现的.

首先在viewWillAppear  方法中定义了一个

 

[self performSelector:@selector(showCallout) withObject:nil afterDelay:1.0];

 

让方法showCallout在1.0秒钟后被调用.

 

- (void)showCallout {
    [mapView selectAnnotation:attackedAnnotation animated:YES];
}

 

上面黄色的部分的方法是官方api中的方法.

 

 

分享到:
评论
1 楼 haipengno1 2011-01-18  
你可以实现MKMapViewDelegate,在mapview的didAddAnnotationViews方法里面执行这个操作

相关推荐

Global site tag (gtag.js) - Google Analytics