如何在地图图钉注释中显示图像? [英] how can I show an image in map pin annotation?

查看:146
本文介绍了如何在地图图钉注释中显示图像?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个视图>> subview mkmapview。

i have one view >> subview mkmapview .

我希望显示图像。 ...我当前的图片是这样的。

in that i want to show image . ...my current image is like this.

我希望像这样展示

我该怎么做?如何在此anotation中添加图像。

how can i do this ? how can i add image in this anotation.

推荐答案

在MKAnnotationView中设置leftCalloutAccessoryView属性

In your MKAnnotationView set the leftCalloutAccessoryView property


leftCalloutAccessoryView要显示在
标准标注气泡左侧的视图。

leftCalloutAccessoryView The view to display on the left side of the standard callout bubble.

@property(保留,非原子)UIView
* leftCalloutAccessoryView讨论此属性的默认值为
nil。左侧标注视图为
,通常用于显示有关注释的信息
或链接到
应用程序提供的
自定义信息。视图的高度
应该是32像素或更少。

@property (retain, nonatomic) UIView *leftCalloutAccessoryView Discussion The default value of this property is nil. The left callout view is typically used to display information about the annotation or to link to custom information provided by your application. The height of your view should be 32 pixels or less.

如果你指定的视图也是UIControl类的
后代,你当点击你的
控件时,
可以使用地图视图的委托给
接收通知。如果它不是来自UIControl的
,那么你的视图是
,负责处理其范围内的任何触摸
事件。

If the view you specify is also a descendant of the UIControl class, you can use the map view’s delegate to receive notifications when your control is tapped. If it does not descend from UIControl, your view is responsible for handling any touch events within its bounds.

可用性在iOS 3.0和
之后。另见@property
canShowCallout相关示例代码
MapCallouts在
中声明MKAnnotationView.h

Availability Available in iOS 3.0 and later. See Also @property canShowCallout Related Sample Code MapCallouts Declared In MKAnnotationView.h

Apple docs

这篇关于如何在地图图钉注释中显示图像?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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