2016-09-02 4 views
2

이 코드는 여기에 을 포함하고 있습니다. 작동하지만 위의 코드는 Userlocation에 나타납니다. 사용자 위치로 이동하려면지도에 애니메이션을 적용하는 대신 ... 원하는 부분입니다. (이 의미가있는 경우) 누구나사용자 추적 모드 누락 애니메이션, 신속한

import UIKit 
import MapKit 
import CoreLocation 

class MapViewController: UIViewController,MKMapViewDelegate, CLLocationManagerDelegate{ 

    @IBOutlet weak var mapView: MKMapView! 

    @IBAction func UserTrackingMode(sender: AnyObject) { 

     mapView.userTrackingMode = .Follow 
    } 
+0

https://developer.apple.com/library/ios/documentation/MapKit/Reference/MKMapView_Class/#//apple_ref/occ/instm/MKMapView/setUserTrackingMode:animated : 그것은 작동 – Paulw11

답변

2

당신은 전환을 애니메이션하기 위해 setUserTrackingMode:animated를 호출 할 수 있습니다 애니메이션으로 사용자 위치에지도 변경을 그 애니메이션을 추가 할 날 뜨거운 말해 단지에 팝업 수 없습니다

@IBAction func UserTrackingMode(sender: AnyObject) { 

    mapView.setUserTrackingMode(.Follow, animated:true) 
} 
+0

! 고마워, 젠장! :) – adirbuilder

관련 문제