本文整理汇总了C#中CLLocationManager.RespondsToSelector方法的典型用法代码示例。如果您正苦于以下问题:C# CLLocationManager.RespondsToSelector方法的具体用法?C# CLLocationManager.RespondsToSelector怎么用?C# CLLocationManager.RespondsToSelector使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CLLocationManager
的用法示例。
在下文中一共展示了CLLocationManager.RespondsToSelector方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Geolocator
/// <summary>
/// Initializes a new instance of the <see cref="Geolocator"/> class.
/// </summary>
public Geolocator()
{
_manager = GetManager();
_manager.AuthorizationChanged += OnAuthorizationChanged;
_manager.Failed += OnFailed;
if (_manager.RespondsToSelector(new Selector("requestWhenInUseAuthorization")))
{
_manager.RequestWhenInUseAuthorization();
}
if (UIDevice.CurrentDevice.CheckSystemVersion(6, 0))
{
_manager.LocationsUpdated += OnLocationsUpdated;
}
else
{
_manager.UpdatedLocation += OnUpdatedLocation;
}
_manager.UpdatedHeading += OnUpdatedHeading;
}
示例2: FinishedLaunching
public override bool FinishedLaunching(UIApplication application, NSDictionary launchOptions)
{
MapServices.ProvideAPIKey ("AIzaSyA8WOvgGyHaw3rgkeYuUIqkIxhmW9Hrdjc");
locationManager = new CLLocationManager ();
locationManager.Delegate = new locationManagerDelegate ();
locationManager.DesiredAccuracy = CLLocation.AccuracyBest;
locationManager.RequestAlwaysAuthorization ();
if (locationManager.RespondsToSelector (new Selector ("requestWhenInUseAuthorization")))
{
locationManager.RequestWhenInUseAuthorization ();
}
if (CLLocationManager.LocationServicesEnabled) {
locationManager.StartUpdatingLocation ();
}
ProgressHUD.Shared.HudForegroundColor = UIColor.Gray;
ProgressHUD.Shared.Ring.Color = UIColor.FromRGB(44/255f,146/255f,208/255f);
ProgressHUD.Shared.HudForegroundColor = UIColor.FromRGB(44/255f,146/255f,208/255f);
UIApplication.SharedApplication.SetStatusBarStyle (UIStatusBarStyle.LightContent, true);
this.Window = new UIWindow (UIScreen.MainScreen.Bounds);
UINavigationController navigation = new UINavigationController(new StartingScreen());
navigation.NavigationBar.TintColor = UIColor.White;
navigation.NavigationBar.BarTintColor = UIColor.FromRGB(44/255f,146/255f,208/255f);
navigation.NavigationBar.BarStyle = UIBarStyle.Black;
navigation.SetNavigationBarHidden (true,true);
this.Window.RootViewController = navigation;
this.Window.MakeKeyAndVisible ();
return true;
}
示例3: ShowActualLocationPermissionAlert
void ShowActualLocationPermissionAlert()
{
_locationManager = new CLLocationManager ();
_locationManager.Delegate = new LocationManagerDelegate (this);
if (_locationAuthorizationType == ClusterLocationAuthorizationType.Always &&
_locationManager.RespondsToSelector (new Selector ("requestAlwaysAuthorization")))
{
_locationManager.RequestAlwaysAuthorization ();
}
else if (_locationAuthorizationType == ClusterLocationAuthorizationType.WhenInUse &&
_locationManager.RespondsToSelector (new Selector ("requestWhenInUseAuthorization")))
{
_locationManager.RequestWhenInUseAuthorization ();
}
_locationManager.StartUpdatingLocation ();
}