Map View always center map on my location

后端 未结 3 525
误落风尘
误落风尘 2021-01-07 04:52

I use the following code to get my location when a user presses a button

 [mapview setShowsUserLocation:YES];

and then the follwoing to cen

3条回答
  •  没有蜡笔的小新
    2021-01-07 05:34

    On swift 3 I prefer use animated method:

    mapView.setUserTrackingMode(.follow, animated: true)
    

    but set property good worked:

    mapView.userTrackingMode = .follow
    

提交回复
热议问题