iphone - 隐藏在地图视图注解视图 [英] iphone - Hide the annotation view in map view

查看:159
本文介绍了iphone - 隐藏在地图视图注解视图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我看来,我已经NAV在顶栏和剩余的观点充满了地图视图。
我的地图视图有针和针的点击,它会显示注释也。
在右上角的导航栏我有一个按钮,并在它的点击,我想删除弹出注解视图。 (注解过的观点是有什么,我想从视图中删除)。
有一个人能告诉我该怎么做。

In my view, i've nav bar at the top and remaining view is filled with map view. My Map view has pins and on click of pin, it will show annotations also. In the top right nav bar i've a button and on click of it, i want to remove the annotation view that popped up. (what ever annotation view is there, i want to remove from the view). Can some one tell me how to do it.

在简单的任务,我们所能做的就是发送一些触摸事件地图视图将其隐藏.....我是对的。怎么办呢?

The simple task we can do is to send some touch event to the map view which will hide it..... am i right. how to do it?

推荐答案

要隐藏标注所有你需要做的是取消选择的注释。你这样做,通过使用...

To hide the callout all you need to do is deselect the selected annotation. You do that by using...

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

例如:

[mapView deselectAnnotation:[mapView.selectedAnnotations objectAtIndex:0] animated:YES];

假设图形页面是你命名了的MKMapView实例。

assuming mapView is what you named your MKMapView instance.

这篇关于iphone - 隐藏在地图视图注解视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆