Xamarin.iOS MKLaunchOptionsDirectionsModeKey

前端 未结 1 1901
灰色年华
灰色年华 2021-01-26 19:15

I\'m trying to set up a dictionary for my MKMapItem, to open the native Map Application set to a certain location with a certain directions mode (walking, driving,

相关标签:
1条回答
  • 2021-01-26 20:00

    You are looking for the MKDirectionsMode Enum.

    launchOptions.Add(MKDirectionsMode.Driving, LaunchOptionsDirectionsMode);
    

    This is found in the MapKit namespace.

    UPDATE You don't need to use a dictionary, in your case you can use the MKLaunchOptions class to set the directions.

    var launchOptions = new MKLaunchOptions();
    launchOptions.DirectionsMode = LaunchOptionsDirectionsMode;
    
    endingItem.OpenInMaps(launchOptions);
    
    0 讨论(0)
提交回复
热议问题