gpt4 book ai didi

iphone - 如何改变MKAnnotation的中心点

转载 作者:太空狗 更新时间:2023-10-30 03:59:43 25 4
gpt4 key购买 nike

我在我的应用程序中将 MKMapkit 用于 map 部分。我必须显示图钉图像 enter image description here作为 MKAnnotation。当我在 map View 中添加注释时,图像的中心指向纬度和经度。但我希望图像的左下角指向指定的纬度和经度。我正在关注链接 MapCallouts用于显示注释。有什么办法可以达到目的。那么请帮忙。

最佳答案

您需要为 centerOffset 设置适当的值注释 View 的属性:

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.

关于iphone - 如何改变MKAnnotation的中心点,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7283442/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com