我试过几件事,但都不能解决。
我在地图上有10个自定义注释,这取决于可见的区域。
现在我有两个按钮,下一个和上一个。单击必须显示注释的详图索引的位置。
也就是说,如果我点击next buton,那么注释1的标注就会出现,当我再次点击next时,第一个标注就会隐藏,第二个标注就会出现。
我试过了
[self.mapView selectAnnotation:self.nextSelectedAnnotationView.annotation animated:YES]和
[self.mapView deselectAnnotation:self.selectedAnnotationView.annotation animated:YES];但主要的问题是如何在这里获得注释??
我尝试过使用NSArray* selectedAnnotations=self.mapview.annotations来获取注解数组
id annotationView =[selectedAnnotations objectAtIndex:i];
[self.mapView selectAnnotation:annotationView animated:YES];但是运气不好:
有没有别的办法来解决我的问题??
发布于 2011-07-12 20:44:04
这可能会对你有帮助。
NSArray *selectedAnnotations = mapView.selectedAnnotations;
for(id annotationView in selectedAnnotations) {
[mapView deselectAnnotation:[annotationView annotation] animated:NO];
}https://stackoverflow.com/questions/6664125
复制相似问题