【问题标题】:How to select the user's location annotation in Swift如何在 Swift 中选择用户的位置注释
【发布时间】:2016-05-02 19:43:51
【问题描述】:

我试图弄清楚当地图首次显示给用户时如何选择用户的默认位置注释。我知道我可能应该以某种方式使用此代码:

mapView.selectAnnotation(theUsersLocationAnnotation, animated: true)

但是,这个“theUsersLocationAnnotation”注释究竟来自哪里,因为它是通常为蓝色的当前位置注释。可以这么说,我将如何访问它以在该注释上调用它?

【问题讨论】:

  • 我的回答对你有帮助吗?

标签: ios swift mkmapview mkannotation


【解决方案1】:

简单使用:

 mapView.selectAnnotation(mapView.userLocation, animated: true)

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-06-07
    • 1970-01-01
    • 1970-01-01
    • 2016-08-22
    • 2015-01-13
    • 1970-01-01
    相关资源
    最近更新 更多