开发者

iPhone: MKAnnotation show popup?

I have a MKMapView that has a pin than when pressed shows the annotation开发者_Python百科's title and subtitle.

Is there a way in code to have this text shown automatically so the user does not need to click it?

If I have many pins, can they all appear as well?


You need to use the selectAnnotation message on MKMapView:

- (void)selectAnnotation:(id <MKAnnotation>)annotation animated:(BOOL)animated

Selects the specified annotation and displays a callout view for it.


This might help:

- (void)setSelected:(BOOL)selected animated:(BOOL)animated


If your MKMapView is called mapView and your MKAnnotation is called myAnnotation then this will work:

[mapView selectAnnotation:myAnnotation animated:YES];
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜