【问题标题】:How to set MKPinAnnotation so that bottom of image points to location instead of center of image如何设置 MKPinAnnotation 使图像底部指向位置而不是图像中心
【发布时间】:2013-08-18 17:06:18
【问题描述】:

如何移动图钉图像以使图像底部指向该位置(如默认图钉)。目前,图像的中心指向该位置(旧金山)。

【问题讨论】:

    标签: objective-c mkmapview mkpinannotationview


    【解决方案1】:

    您需要计算要偏移的像素数,然后设置centerOffset 属性。

    默认情况下,注释视图的中心点位于 相关注释的坐标点。你可以使用这个 属性以根据需要重新定位注释视图。这个 x 和 y 偏移值以像素为单位。正偏移值移动 注释视图向下和向右,而负值移动它 向上和向左。

    【讨论】:

      猜你喜欢
      • 2018-06-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-09-23
      • 2019-03-11
      • 2012-10-19
      相关资源
      最近更新 更多