ios - 快速删除 MKMap View 上的 "My Location"注释

标签 ios swift dictionary annotations location

问题:

我希望禁止触摸用户位置以阻止“我的位置”注释


我一直在寻找解决方案一段时间,经过广泛的在线研究后,我什至还没有找到这个问题。

我创建了一个用 Swift 编写的移动应用程序,其中有关于 MKMap View 的注释。我遇到的问题是当用户选择他们附近的注释时,它有时会显示此“我的位置”注释而不是显示正确的注释。

我确信有办法阻止这个注释,我已经写了一个声明来帮助我识别弹出窗口

        if (((view.annotation?.title)!)! == "My Location"){
            print("wrong annotation selected")

有什么方法可以禁用对用户位置图标的触摸吗?

我已经使用

更改了圆圈的颜色
map.tintColor = UIColor(red:0.19, green:0.69, blue:0.73, alpha:1.0)

所以我在想可能会有一个

map.UserLocationTouch = false 

或类似的东西。

Looking to remove this pop-out

最佳答案

mapView.userLocation.title = ""

并且当您按下时注释不会出现。

关于ios - 快速删除 MKMap View 上的 "My Location"注释,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47560794/

相关文章:

objective-c - iOS解析不同json字符串的正确条件

ios - 当我们点击按钮时,如何在 Ios 中设置自动布局?

ios - 检查哪个 View 发送 gestureRecognizer

swift - Xcode 9.4 Playground Swift 控制台输出

swift - 在 Swift 中将 MPMoviePlayerController 正确放置在 UIView 中

swift - 如何让我的 tableview 中的一个部分下的多个项目按字母顺序排序?

python - 列出字典值的理解

swift - 在 Swift 中对字典进行排序

c# - C# 中带有字典的 InvalidCastException

ios 第二次设置为 localnofication fireDate 它不能正常工作