How to change the centre point of MKAnnotation
我正在将MKMapkit用于我的应用程序中的地图剖面。
我必须将钉图显示为MKAnnotation。当我在地图视图中添加注释时,图像的中心指向纬度和经度。但我希望图像的左下角应指向指定的纬度和经度。
我正在跟踪用于显示注释的MapCallouts链接。
有什么办法可以实现目标。
那请帮忙。
您需要为注释视图的centerOffset属性设置适当的值:
centerOffset
By default, the center point of an annotation view is placed at the
coordinate point of the associated annotation. You can use this
property to reposition the annotation view as needed. This x and y
offset values are measured in pixels. Positive offset values move the
annotation view down and to the right, while negative values move it
up and to the left.