小编Cai*_*lin的帖子

放大用户位置 - Swift

我无法弄清楚如何让地图从viewDidLoad放大用户位置.我尝试设置一个区域,但这不起作用.这是我的代码,任何提示?

@IBOutlet弱var mapView:MKMapView!var MapViewLocationManager:CLLocationManager!= CLLocationManager()var currentLocation:PFGeoPoint!= PFGeoPoint()

override func viewDidLoad() {
    super.viewDidLoad()
    self.mapView.showsUserLocation = true
    mapView.delegate = self
   MapViewLocationManager.delegate = self
    mapView.setUserTrackingMode(MKUserTrackingMode.Follow, animated: true)
}
Run Code Online (Sandbox Code Playgroud)

我已经查找了这个问题的答案但是没有在Swift中找到答案或者确实有效.谢谢!!

mapkit ios swift

5
推荐指数
3
解决办法
1万
查看次数

标签 统计

ios ×1

mapkit ×1

swift ×1