How to play button to switch setUserTrackingMode in MapView under ios6?

In the following code, you can configure the button to switch setUserTrackingMode in the navigation bar.

// set MKUserTrackingBarButton // source: http://stackoverflow.com/questions/9876157/is-the-current-location-compass- heading-button-available-in-the-ios-sdk MKUserTrackingBarButtonItem *buttonItem = [[MKUserTrackingBarButtonItem alloc] initWithMapView:self.mapView]; self.navigationItem.rightBarButtonItem = buttonItem; // set tracking mode [self.mapView setShowsUserLocation:YES]; [self.mapView setUserTrackingMode:MKUserTrackingModeFollowWithHeading animated:YES]; 

How to do this (bottom left button in the map) Does Apple do this on Maps? (Sorry, I cannot post an image explaining it)

+4
source share
1 answer

You can add MKUserTrackingBarButton to the UIToolbar , which is located at the bottom of the screen (and possibly has its own background). This should allow the behavior of Maps.app to be reproduced.

0
source

Source: https://habr.com/ru/post/1441111/


All Articles