swift - 导航按钮 用户位置

标签 swift location mapkit

我需要什么样的代码才能使我的栏按钮像在 Google map 中一样定位并缩放到用户的位置?我尝试了以下方法:

if Navigationbutton != nil {
    Navigationbutton.target = MKMapView()
    Navigationbutton.action = CLLocationCoordinate2D (latitude: location!.coordinate.latitude, longitude: location.coordinate.longitude)

最佳答案

关于swift - 导航按钮 用户位置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39411859/

相关文章:

ios - SwiftUI 应用程序崩溃并出现 "attempt to insert row 2 into section 0, but there are only 2 rows in section 0 after the update"错误

swift - 将数据写入 Firebase 不起作用 - 无法将类型 'user' 的值转换为预期参数类型 'AnyObject?'

Android Location Wifi 重启后无法使用

ios - 在 UITableView 滚动时更新 MKMapView,从单元格获取坐标

iphone - 重用自定义绘制的注释 View

iOS SDK - MapKit MKAnnotationView 问题 - 位置和多个注释?

swift - Xcode:方法参数的代码完成

swift - 表达式类型 '()' 在没有更多 XCTAssertEqual 上下文的情况下不明确

ios - Phonegap iOS应用被拒绝使用GPS

c# - 检查 GPS 和互联网是否在 Windows 8 Phone 应用程序中打开?